创建管理员账号
use admin db.createUser( { user: "root", pwd: "xxxxxx", roles: [ { role: "root",db:"admin" } ] } )
其他库创建账号
db.createUser( { user:"自定义账号", pwd:"密码", roles: [ { role:"dbOwner", db:"localInstruct" } ] } )
标签:roles,账号,admin,mongodb,db,createUser,基本操作,合集 From: https://www.cnblogs.com/rtnb/p/16866357.html