On this page本页内容
dropRole
Deletes a user-defined role from the database on which you run the command.从运行命令的数据库中删除用户定义的角色。
The dropRole command uses the following syntax:dropRole命令使用以下语法:
{
dropRole: "<role>",
writeConcern: { <write concern> },
comment: <any>
}
The dropRole command has the following fields:dropRole命令包含以下字段:
dropRole | string | |
writeConcern | document |
|
comment | any |
|
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.runCommand(
{
dropRole: "readPrices",
writeConcern: { w: "majority" }
}
)