Navigation

mongocli iam project delete

On this page

The mongocli iam project delete command deletes a project using the specified profile. The specified profile must contain an API key with the Project Owner role for the project you want to delete. When you run the command without the --force option, the command prompts you to confirm the operation.

Syntax

mongocli iam project delete <project-ID>
     [ --force]
     [ --profile|-P <profile-name> ]

Note

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

Options

Option Type Description Required?
--force   Flag that indicates that the project can be deleted without requiring confirmation. no
<project-ID> string Unique identifier of the project you want to delete. yes
--profile, -P string Name of the profile that contains the access information for the project you want to delete. If omitted, uses the default profile. no

Output

If the command succeeds, it prints a confirmation message similar to the following to the terminal. If the command prints an error, see Troubleshooting for recommended solutions.

Project '<project-id'> deleted

Examples

Example 1

The following command deletes a project with the Project ID 5e33545ef10fab20b49c0f3b in an Ops Manager organization. The command uses the default profile, which contains API keys that have the Project Owner role for this project.

mongocli iam project delete 5e33545ef10fab20b49c0f3b

The previous command prints the following to the terminal. For more information on these fields, see Output.

Project '5e33545ef10fab20b49c0f3b' deleted

Example 2

The following command deletes a project in an Atlas organization without requiring confirmation. The command uses the default profile, which contains API keys that have the Project Owner role for this project.

mongocli iam project delete 9dj3545ef10fab20b49c0f3b --force

The previous command prints the following to the terminal:

Project '9dj3545ef10fab20b49c0f3b' deleted