mongocli atlas 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 atlas dbusers create [options]
Options
Name | Type | Required | Description |
---|---|---|---|
--awsIAMType | string | false | AWS IAM method by which the provided username is authenticated.
Valid values: NONE|USER|ROLE. (default "NONE") |
--deleteAfter | string | false | Timestamp in ISO 8601 date and time format in UTC after which Atlas deletes the user. |
-h, --help | false | help for create | |
--ldapType | string | false | LDAP method by which the provided username is authenticated.
Valid values: NONE|USER|GROUP. (default "NONE") |
-o, --output | string | false | Output format.
Valid values: json|json-path|go-template|go-template-file |
-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. |
--scope | strings | false | Array of clusters and Atlas Data Lakes that this user has access to. |
-u, --username | string | true | Username for authenticating to MongoDB. |
--x509Type | string | false | X.509 method by which the provided username is authenticated.
Valid values: NONE|MANAGED|CUSTOMER. (default "NONE") |
Inherited Options
Name | Type | Required | Description |
---|---|---|---|
-P, --profile | string | false | Profile to use from your configuration file. |
Examples
Create an Atlas admin user $ mongocli atlas dbuser create atlasAdmin --username <username> --projectId <projectId> Create user with read/write access to any database $ mongocli atlas dbuser create readWriteAnyDatabase --username <username> --projectId <projectId> Create user with multiple roles $ mongocli atlas dbuser create --username <username> --role clusterMonitor,backup --projectId <projectId> Create user with multiple scopes $ mongocli atlas dbuser create --username <username> --role clusterMonitor --scope clusterName:CLUSTER,DataLakeName:DATA_LAKE --projectId <projectId>