On this page本页内容
db.dropAllRoles( writeConcern )
Deletes all user-defined roles on the database where you run the method.删除运行该方法的数据库上的所有用户定义角色。
The db.dropAllRoles()
method removes alluser-defined roles from the database.db.dropAllRoles()
方法从数据库中删除用户定义的角色。
The db.dropAllRoles()
method takes the following argument:db.dropAllRoles()
方法采用以下参数:
writeConcern | document |
|
The db.dropAllRoles()
method wraps the dropAllRolesFromDatabase
command.db.dropAllRoles()
方法包装dropAllRolesFromDatabase
命令。
If run on a replica set, 如果在副本集上运行,db.dropAllRoles()
is executed using "majority"
write concern by default.db.dropAllRoles()
在默认情况下使用"majority"
写入关注点执行。
You must have the 必须对数据库执行dropRole
action on a database to drop a role from that database.dropRole
操作才能从该数据库中删除角色。
The following operations drop all user-defined roles from the 以下操作将从产品数据库中删除所有用户定义的角色,并使用products
database and uses a write concern of majority
."majority"
写入关注点。
use products db.dropAllRoles( { w: "majority" } )
The method returns the number of roles dropped:该方法返回被删除的角色数:
4