On this page本页内容
db.dropAllRoles(writeConcern)¶Deletes all user-defined roles on the database where you run the method.
Warning
The dropAllRoles method removes all user-defined roles from the database.
The dropAllRoles method takes the following argument:
writeConcern |
document | writeConcern document takes the same fields as the getLastError command. |
| Returns: | The number of user-defined roles dropped. |
|---|
The db.dropAllRoles() method wraps the dropAllRolesFromDatabase command.
If run on a replica set, db.dropAllRoles() is executed using majority write concern by default.
The following operations drop all user-defined roles from the products database and uses a write concern of majority.
The method returns the number of roles dropped: