On this page本页内容
db.dropAllUsers(writeConcern)¶Removes all users from the current database.
Warning
The dropAllUsers method removes all users from the database.
The dropAllUsers method takes the following arguments:
writeConcern |
document | writeConcern document takes the same fields as the getLastError command. |
The db.dropAllUsers() method wraps the dropAllUsersFromDatabase command.
If run on a replica set, db.dropAllUsers() is executed using majority write concern by default.
The following db.dropAllUsers() operation drops every user from the products database.
The n field in the results document shows the number of users removed: