翻译或纠错本页面
- Reference >
- mongo Shell Methods >
- User Management Methods
User Management Methods¶
Name | Description |
---|---|
db.createUser() | Creates a new user. |
db.addUser() | Deprecated. Adds a user to a database, and allows administrators to configure the user’s privileges. |
db.updateUser() | Updates user data. |
db.changeUserPassword() | Changes an existing user’s password. |
db.removeUser() | Deprecated. Removes a user from a database. |
db.dropAllUsers() | Deletes all users associated with a database. |
db.dropUser() | Removes a single user. |
db.grantRolesToUser() | Grants a role and its privileges to a user. |
db.revokeRolesFromUser() | Removes a role from a user. |
db.getUser() | Returns information about the specified user. |
db.getUsers() | Returns information about all users associated with a database. |