我有一个数据库,现在我想删除其中一个用户的权限。
我的命令如下:
> show dbs
admin 0.000GB
users 0.000GB
local 0.000GB
> use admin
switched to db admin
> show users
{
"_id" : "admin.root",
"user" : "root",
"db" : "admin",
"roles" : [
{
"role" : "readWriteAnyDatabase",
"db" : "admin"
},
{
"role" : "userAdminAnyDatabase",
"db" : "admin"
},
{
"role" : "dbAdminAnyDatabase",
"db" : "admin"
},
{
"role" : "clusterAdmin",
"db" : "admin"
}
]
}
{
"_id" : "admin.myuser",
"user" : "myuser",
"db" : "admin",
"roles" : [
{
"role" : "root",
"db" : "admin"
}
]
}
当我想要删除用户 myuser
时,我会使用以下命令:
> db.dropUser(myuser)
2016-02-11T14:13:21.107+0000 E QUERY [thread1] ReferenceError: myuser is not defined :
@(shell):1:1
这个问题的原因是什么,我怎样才能从我的数据库中删除这个用户?