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

mongocli iam projects users delete

On this page

  • Permissions Required
  • Syntax
  • Arguments
  • Options
  • Output
  • Example

The mongocli iam projects users delete command deletes a user in the MongoDB service project. You can also delete users in your MongoDB service project using the:

  • Atlas UI and API

  • Cloud Manager UI and API

  • Ops Manager UI and API

The following table shows the role you must have to delete a user from the MongoDB service project.

MongoDB Service
Role

Atlas

Cloud Manager

Ops Manager

mongocli iam projects users delete <user-id>
[ --force ]
[ --profile|-P <profile-name> ]
[ --projectId <project-ID> ]

Note

Use -h or --help to view the command-line help for this command.

Argument
Type
Description
Required?
<user-id>
string
Unique identifier of the user you want to delete from the project. You can run the mongocli iam projects users list command to retrieve the user's ID.
yes
Option
Type
Description
Required?
--force
Flag that indicates that the project-user can be deleted without requiring confirmation.
no
--profile, -P
string
Name of the profile that contains the access information. If omitted, uses the default profile.
no
--projectId
string

Unique identifier of the project. If omitted, uses the project ID in the profile or environment variable.

no

The command prints the following output to the terminal if the command succeeds. If the command returns errors, see Troubleshooting for recommended solutions.

User '<user-id>' deleted from the project

The following command deletes a user with ID 5e44445ef10fab20b49c0f31 in an Atlas project. It uses the default profile for accessing Atlas.

mongocli iam projects users delete 5e44445ef10fab20b49c0f31 --force

The previous command prints the following to the terminal.

User '5e44445ef10fab20b49c0f31' deleted from the project

Back

Delete One Ops Manager User