use admin
db.createUser({ user: "mongoadmin" , pwd: "mongoadmin", roles: ["userAdminAnyDatabase", "dbAdminAnyDatabase", "readWriteAnyDatabase"]})
use <your database>
db.createUser({
user: '<some username>',
pwd: passwordPrompt(),
roles: [{
role: 'readWrite',
db: '<your database>'
}]
})
use admin
db.createUser(
{
user: "username",
pwd: "password",
roles: [ "root" ]
}
)
use admin
db.createUser({
user: "username",
pwd: "password",
roles: [ "root" ]
})