Docs Menu
Docs Home
/ /
MongoDB Command Line Interface
/ / /

mongocli iam user describe

On this page

  • Syntax
  • Options
  • Output
  • Example

The mongocli iam user describe command retrieves information about a user specified by username or ID. You can also retrieve details about a user using the API for your MongoDB service:

mongocli iam user describe
--id <user-id>
[ --output|-o <output-format> ]
[ --profile|-P <profile-name> ]
--username <username-of-user>

Note

Use -h or --help to view the command-line help for this command.

Option
Type
Description
Required?
--id
string
Unique identifier of the user. Either id or username is required.
conditional
--output, -o
string

Command output format. Valid values are:

  • json for output in JSON format

  • go-template for custom output using the Go template

  • go-template-file for custom output specified using Go template file

If omitted, the command returns output in the default format.

no
--profile, -P
string
Name of the profile that contains the access information. If omitted, uses the default profile.
no
--username
string
Username of the user. Either username or id is required.
conditional

The command prints the following output to the terminal if the command succeeds. If the command returns errors, see Troubleshooting for recommended solutions.

ID FIRST NAME LAST NAME USERNAME EMAIL
<user-email> <first-name> <last-name> <username> <email-address>

The above default output is a subset of the fields returned by this command. For the complete list of JSON fields returned by the command, see the API reference for your MongoDB service:

The following command returns information in the default format about a user whose ID is 5dd56c847a3e5a1f363d424d in a Cloud Manager organization. It uses the default profile for accessing Cloud Manager.

mongocli iam user describe --id 5dd56c847a3e5a1f363d424d

The previous command prints the following to the terminal:

ID FIRST NAME LAST NAME USERNAME EMAIL
5dd56c847a3e5a1f363d424d John Doe john.doe@example.com john.doe@example.com

The following command returns information in JSON format about a user whose username is john.doe@example.com in an Atlas organization. It uses the default profile for accessing Atlas.

mongocli iam user describe --username "john.doe@example.com" -o json

The previous command prints the following in the specified format to the terminal. For more information on these fields, see Output.

{
"emailAddress": "john.doe@example.com",
"firstName": "John",
"id": "5dd56c847a3e5a1f363d424d",
"lastName": "Doe",
"roles": [
{
"groupId": "5f455b39749bea5fb575dccc",
"roleName": "GROUP_OWNER"
},
{
"orgId": "5e2f05fef10fab66c7d408b3",
"roleName": "ORG_OWNER"
}
],
"username": "john.doe@mongodb.com",
"mobileNumber": "",
"password": "",
"country": "US"
}

Back

List Project Users