3

Is there any way to dynamically create a new database in mongo using the 3.x Java driver along with adding a user with defined roles to it?

4
  • I don't think its supported through java drivers. You should use mongo shell for this purpose. Commented Dec 16, 2016 at 18:26
  • I have read in few answers that it could be lazily created but those were using DBObject Commented Dec 17, 2016 at 9:46
  • Please add examples and I'll be happy to help you convert them to 3 x Commented Dec 17, 2016 at 11:42
  • stackoverflow.com/a/26952982/5829549 check this Commented Dec 18, 2016 at 21:41

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.