Navigation

mongocli atlas cluster delete

On this page

The cluster delete command deletes the specified cluster in the specified Atlas project. The command prompts you to confirm the operation when you run the command without the --force option.

You can also delete a cluster using the Atlas UI or API.

Warning

Deleting a cluster also deletes any backup snapshots for that cluster.

Syntax

mongocli atlas cluster delete <cluster-name>
     [ --force ]
     [ --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.

Options

Option Type Description Required?
<cluster-name> string Name of the cluster to delete. yes
--force   Flag that indicates that the cluster 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
--profile, -P string Name of the profile to use for accessing the Atlas project. If omitted, uses the default profile. no
--projectId string Unique identifier of the project containing the cluster to delete. yes

Output

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

Cluster deleted

Examples

The following examples use the mongocli atlas cluster delete command to delete a sample cluster named myCluster.

Example 1

The following mongocli atlas cluster delete command deletes a cluster named myCluster after prompting for a confirmation. It uses the profile named egAtlasProfile for accessing the Atlas project.

mongocli atlas cluster delete myCluster --profile egAtlasProfile
Are you sure you want to delete: myCluster Yes

The command prints the following to the terminal:

Cluster deleted

Example 2

The following mongocli atlas cluster delete command deletes a cluster named myCluster without requiring confirmation. It uses the default profile for accessing the Atlas project.

mongocli atlas cluster delete myCluster --projectId 5e2211c17a3e5a48f5497de3 --force

The command prints the following to the terminal:

Cluster deleted