Docs Menu

Docs HomeMongoDB Command Line Interface

mongocli atlas dbusers update

On this page

  • Syntax
  • Arguments
  • Options
  • Inherited Options
  • Examples

Update a database user for your project.

mongocli atlas dbusers update <username> [options]
Name
Type
Required
Description
username
string
false
Username to update in the MongoDB database.
Name
Type
Required
Description
-h, --help
false
help for update
-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
false
Username for authenticating to MongoDB.
Name
Type
Required
Description
-P, --profile
string
false
Profile to use from your configuration file.
Update roles for a user
$ mongocli atlas dbuser update <username> --role readWriteAnyDatabase --projectId <projectId>
Update scopes for a user
$ mongocli atlas dbuser update <username> --scope resourceName:resourceType --projectId <projectId>
←  mongocli atlas dbusers listmongocli atlas events →
Share Feedback