mongocli ops-manager dbusers create
On this page
This version of the documentation is archived and no longer supported. View the current documentation to learn how to upgrade your version of MongoCLI.
Create a database user for your project.
Syntax
mongocli ops-manager dbusers create [options]
Options
Name | Type | Required | Description |
---|---|---|---|
--authDB | string | false | Authentication database name. (default "admin") |
-h, --help | false | help for create | |
--mechanisms | strings | false | Authentication mechanism.
Valid values: SCRAM-SHA-1|SCRAM-SHA-256 (default [SCRAM-SHA-1]) |
-p, --password | string | false | User’s password. |
--projectId | string | false | Project ID to use. Overrides configuration file or environment variable settings. |
--role | strings | false | User's roles and the databases or collections on which the roles apply. |
-u, --username | string | true | Username for authenticating to MongoDB. |
Inherited Options
Name | Type | Required | Description |
---|---|---|---|
-P, --profile | string | false | Profile to use from your configuration file. |
Examples
Create a user with readWriteAnyDatabase and clusterMonitor access $ mongocli om dbuser create --username <username> --role readWriteAnyDatabase,clusterMonitor --mechanisms SCRAM-SHA-256 --projectId <projectId>
Auto generated by MongoDB CLI on 29-Jun-2021