Answers for "mongodb create user for all databases"

0

mongodb create admin user for all databases

use admin
db.createUser({ user: "mongoadmin" , pwd: "mongoadmin", roles: ["userAdminAnyDatabase", "dbAdminAnyDatabase", "readWriteAnyDatabase"]})
Posted by: Guest on March-13-2020
1

create admin user in mongodb

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

mongodb create user

use admin
db.createUser(
   {
     user: "restricted",
     pwd: passwordPrompt(),      // Or  "<cleartext password>"
     roles: [ { role: "readWrite", db: "reporting" } ],
     authenticationRestrictions: [ {
        clientSource: ["192.0.2.0"],
        serverAddress: ["198.51.100.0"]
     } ]
   }
)
Posted by: Guest on June-02-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 "mongodb create user for all databases"

Code answers related to "Javascript"

Browse Popular Code Answers by Language