Home > AI > Database > MongoDB >

manage users

show users

db.getUsers();

Delete one user

db.dropUser(username, writeConcern)

Create one user

db.createUser( {
   user:"user123",
   pwd: passwordPrompt(),   // Instead of specifying the password in cleartext
   roles:[ "userAdminAnyDatabase", "readWriteAnyDatabase" ]
} )

Leave a Reply