授予权限db.grantRolesToUser

>use test1
>db.grantRolesToUser("a1",[{role:"readWrite",db:"test2"}])

对数据库test1中的a1用户授予test2数据库的读写权限

 

相关文章: