db.createUser(
{
user: "admin",
pwd: "password",
"roles": [
{ "role": "root", "db": "admin" },
{ "role": "clusterAdmin", "db": "admin" },
{ "role": "userAdminAnyDatabase", "db": "admin" }
],
}
)
db.createUser(
{
"user": "npc_user",
"pwd": "supersecret",
"roles": [ { "role" : "dbOwner", "db" : "my_special_db" } ],
}
)
db.getUser("npc_user")
db.getUsers()
db.dropUser("npc_user")