mongocli ops-manager dbuser list¶
The dbuser list
command retrieves the list of MongoDB database users
on the specified MongoDB Ops Manager clusters in the given project.
Syntax¶
mongocli ops-manager|om dbuser list|ls [ --output|-o <output-format> ] [ --profile|-P <profile-name> ] [ --projectId <project-ID> ]
Use -h
or --help
to view the command-line help for
this command.
Options¶
Option | Type | Description | Required? |
--authDB | string | Name of the authentication database for this user. Defaults to
admin . | no |
--output , -o | string | Command output format. Valid values are:
If omitted, the command returns output in the default format. | no |
--profile , -P | string | Name of the profile where the public and private
keys for the project are saved. If omitted, uses the
default profile. To learn more about creating a
profile, see Configure the MongoDB CLI. | no |
--projectId | string | Unique identifier of the project. If omitted, uses the project ID in the profile or environment variable. | no |
Output¶
The command prints the following fields in the specified format to the terminal if the command succeeds. If the command prints an error, see Troubleshooting for recommended solutions.
Field | Description |
---|---|
user | Username of the MongoDB user. |
db | User's authentication database. |
roles | User's roles and the databases or collections on which the
roles apply. |
mechanisms | The authentication mechanisms
in use by the specified cluster. |
scramSha256Creds | The user's SCRAM-SHA-256 credentials. Only appears if the SCRAM-SHA-256
authentication mechanism is in use. |
scramSha1Creds | The user's SCRAM-SHA-1 credentials. Only appears if the SCRAM-SHA-251
authentication mechanism is in use. |
Example¶
The following example uses the mongocli ops-manager dbuser list
command
to retrieve the list of MongoDB database users on the Ops Manager
cluster.
The command uses the default profile, which contains
the Programmatic API Key