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

mongocli ops-manager dbuser delete

On this page

  • Syntax
  • Options
  • Output
  • Example

The dbuser delete command deletes a MongoDB database user from the specified Ops Manager clusters in the given project. You can also delete a MongoDB database user through the Ops Manager UI.

mongocli requests a confirmation from the user before sending the delete command to Ops Manager.

mongocli ops-manager dbuser delete <username>
--authDB
[ --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.

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:

  • json for output in JSON format

  • go-template for custom output using the Go template

  • go-template-file for custom output specified using Go template file

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
<username>
string
Username for authenticating the user to MongoDB.
yes

A successful dbuser delete command returns an in-progress status message with a link to your Ops Manager topology page.

The example below uses the mongocli ops-manager dbuser delete command to delete a MongoDB database user with the username user1.

The command uses the default profile to access Ops Manager.

mongocli ops-manager dbuser delete user1

Back

Create a Database User