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> ]
Note
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 Keys and the project ID.
mongocli ops-manager dbuser list --output json
The previous command prints the following fields to the terminal. To learn more about these fields, see Output.
Note
This output is particular to this Ops Manager
cluster. The output for
your cluster may be different.
[ { "user": "user1", "db": "admin", "roles": [ { "role": "readWriteAnyDatabase", "db": "admin" } ], "scramSha256Creds": { "iterationCount": 15000, "salt": "w3sthRPXyl525zfSe/s77hObK9yU+JotgQ==", "serverKey": "zR3mTXUSJayWVsN4UNgONyRvGC4QAnTjQK/K4J4=", "storedKey": "kPqSzd01cfzvLy7ihVweV/kjO2pEM81iROgh6g=" }, "mechanisms": [ "SCRAM-SHA-256" ] }, { "user": "user2", "db": "test", "roles": [ { "role": "read", "db": "test" } ], "scramSha1Creds": { "iterationCount": 10000, "salt": "9G2BNWxfIRXyacLOTWA==", "serverKey": "SxdzrJOsNj9ALtKbdCfju8A=", "storedKey": "kVrmPviw9MgNl6Mw/xxZomo=" }, "mechanisms": [ "SCRAM-SHA-1" ] } ]