What built-in MongoDB roles permit a user to create a new databases and users for all databases?

34 Views Asked by At

MongoDB's documentation is clear about roles needed for other operations. I may be overlooking something, but I couldn't find a clear description of how to create a new database.

I am trying to do this from a remote Node.js server. One that should be able to create databases and create users.

1

There are 1 best solutions below

0
On BEST ANSWER

According to the MongoDB documentation you need the dbAdmin and userAdmin roles, but the dbOwner role also can fit your needs (depends on the details of your task). Also you can create a custom role.