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 | writeConcern document takes the same fields as the getLastError command.writeConcern文档采用与getLastError命令相同的字段。 |
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角色: