Answers for "mongodb roles users html.it"

0

mongodb readwrite to all dbs

use admin
db.createUser({
  user: '<some username>',
  pwd: passwordPrompt(),		// or '<your password>'
  roles: [ "userAdminAnyDatabase", "readWriteAnyDatabase" ]
})
Posted by: Guest on October-07-2020
-1

mongodb add admin user

use admin
db.createUser({
  user: "username",
  pwd: "password",
  roles: [ "root" ]
})
Posted by: Guest on July-17-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language