On this page本页内容
db.dropRole( rolename, writeConcern )
Deletes a user-defined role from the database on which you run the method.从运行该方法的数据库中删除用户定义的角色。
The db.dropRole()
method takes the following arguments:db.dropRole()
方法采用以下参数:
rolename | string | |
writeConcern | document |
|
The db.dropRole()
method wraps the dropRole
command.db.dropRole()
方法包装了dropRole
命令。
If run on a replica set, 如果在副本集上运行,db.dropRole()
is executed using "majority"
write concern by default.db.dropRole()
在默认情况下使用"majority"
写入关注点执行。
You must have the 必须对数据库执行dropRole
action on a database to drop a role from that database.dropRole
操作才能从该数据库中删除角色。
The following operations remove the 以下操作将从readPrices
role from the products
database:products
数据库中删除readPrices
角色:
use products db.dropRole( "readPrices", { w: "majority" } )