We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Create mongodb admin user
db.createUser({user: "admin", pwd: "admin", roles: [{role: "userAdminAnyDatabase", db: "admin"}]});
Create mongodb user for db, mongo command line
use db; //switched to db
db.createUser({user: "xxx",pwd: "xxx",roles: [ { role: "userAdmin", db: "db"}]})