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" } } )