User Management Methods用户管理方法

Note注意

For details on specific methods, including syntax and examples, click on the specific method to go to its reference page.有关特定方法的详细信息,包括语法和示例,请单击特定方法以转到其参考页面。

Name名称Description描述
db.auth()Authenticates a user to a database.向数据库验证用户。
db.changeUserPassword()Changes an existing user's password.更改现有用户的密码。
db.createUser()Creates a new user.创建新用户。
db.dropUser()Removes a single user.删除单个用户。
db.dropAllUsers()Deletes all users associated with a database.删除与数据库关联的所有用户。
db.getUser()Returns information about the specified user.返回有关指定用户的信息。
db.getUsers()Returns information about all users associated with a database.返回与数据库关联的所有用户的信息。
db.grantRolesToUser()Grants a role and its privileges to a user.向用户授予角色及其权限。
db.removeUser()Deprecated. 不赞成Removes a user from a database.从数据库中删除用户。
db.revokeRolesFromUser()Removes a role from a user.从用户中删除角色。
db.updateUser()Updates user data.更新用户数据。
passwordPrompt()Prompts for the password as an alternative to specifying passwords directly in various mongosh user authentication/management methods.提示输入密码,以替代在各种mongosh用户身份验证/管理方法中直接指定密码。
←  Bulk.toString()db.auth() →