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

mongocli cloud-manager dbusers create

On this page

  • Syntax
  • Options
  • Inherited Options
  • Examples

Create a database user for your project.

mongocli cloud-manager dbusers create [options]
Name
Type
Required
Description
--authDB
string
false
Authentication database name. This value defaults to "admin".
-h, --help
false
help for create
--mechanisms
strings
false
Authentication mechanism. Valid values are SCRAM-SHA-1 or SCRAM-SHA-256. This value defaults to [SCRAM-SHA-1].
-p, --password
string
false
User's password.
--projectId
string
false
Project ID to use. Overrides the settings in the configuration file or environment variable.
--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.
Name
Type
Required
Description
-P, --profile
string
false
Profile to use from your configuration file.
Create a user with readWriteAnyDatabase and clusterMonitor access
$ mongocli om dbuser create --username <username> --role readWriteAnyDatabase,clusterMonitor --mechanisms SCRAM-SHA-256 --projectId <projectId>

Back

dbusers