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:
username |
string | The name of the user for which to retrieve information. |
args |
document |
The args
document supports the following fields:
showCredentials |
boolean | false . |
showPrivileges |
boolean | false . If viewing all users, you cannot specify this field. |
showAuthenticationRestrictions |
boolean | false . If viewing all users, you cannot specify this field. |
filter |
document |
|
db.getUser()
wraps the usersInfo: <username>
command.
For details on output, see
To view another user’s information, you must have the viewUser
action on the other user’s database.
Users can view their own information.
The following sequence of operations returns information about the appClient
user on the accounts
database: