On this page本页内容
db.dropAllUsers(writeConcern)¶Removes all users from the current database.从当前数据库中删除所有用户。
Warning
The dropAllUsers method removes all users from the database.dropAllUsers方法从数据库中删除所有用户。
The dropAllUsers method takes the following arguments:dropAllUsers方法采用以下参数:
writeConcern |
document | writeConcern document takes the same fields as the getLastError command.writeConcern文档采用与getLastError命令相同的字段。 |
The db.dropAllUsers() method wraps the dropAllUsersFromDatabase command.db.dropAllUsers()方法包装dropAllUsersFromDatabase命令。
If run on a replica set, 如果在副本集上运行,默认情况下,db.dropAllUsers() is executed using majority write concern by default.db.dropAllUsers()将使用majority写入关注点执行。
You must have the 要从数据库中删除用户,必须对数据库执行dropUser action on a database to drop a user from that database.dropUser操作。
The following 下面的db.dropAllUsers() operation drops every user from the products database.db.dropAllUsers()操作会从products数据库中删除每个用户。
The 结果文档中的n field in the results document shows the number of users removed:n字段显示删除的用户数: