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

mongocli iam project delete

On this page

  • Syntax
  • Options
  • Output
  • Examples

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.

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

Note

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

Option
Type
Description
Required?
--force
Flag that indicates that the project can be deleted without requiring confirmation.
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
<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

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

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

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

Back

Describe a Project