On this page本页内容
db.
getUser
(username, args)¶Returns user information for a specified user. 返回指定用户的用户信息。Run this method on the user’s database. 在用户的数据库上运行此方法。The user must exist on the database on which the method runs.该用户必须存在于运行该方法的数据库中。
The db.getUser()
method has the following parameters:db.getUser()
方法具有以下参数:
username |
string | |
args |
document |
The args
document supports the following fields:args
文档支持以下字段:
showCredentials |
boolean | true 以显示用户的密码哈希。false .false 。 |
showPrivileges |
boolean | true 以显示用户的全部权限集,包括继承角色的扩展信息。false . false 。 |
showAuthenticationRestrictions |
boolean | true 以显示用户的身份验证限制。false . false 。 |
filter |
document |
|
db.getUser()
wraps the 包装usersInfo: <username>
command.usersInfo: <username>
命令。
For details on output, see有关输出的详细信息,请参阅
To view another user’s information, you must have the 要查看其他用户的信息,必须对其他用户的数据库执行viewUser
action on the other user’s database.viewUser
操作。
Users can view their own information.用户可以查看自己的信息。
The following sequence of operations returns information about the 以下操作序列将返回appClient
user on the accounts
database:accounts
数据库中有关appClient
用户的信息: