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

mongocli atlas backup snapshots delete

On this page

  • Syntax
  • Options
  • Output
  • Example

The backup snapshots delete command deletes a specified backup snapshot. You can also delete a snapshot through the Atlas UI or API.

mongocli atlas backup snapshots delete <snapshot-id>
--clusterName <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.

Option
Type
Description
Required?
<snapshot-id>
string
Unique identifier of the snapshot.
yes
--clusterName
string
Name of the cluster.
yes
--force
Flag that indicates that the snapshot 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 where the project ID and the Programmatic API 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

If the command is successful, it returns the following response:

Snapshot '<snapshot-id>' deleted

The following example uses the mongocli atlas backup snapshots delete command to delete a backup snapshot for the cluster named myDemo. The command uses the default profile, where the project ID and the Programmatic API Keys are stored.

mongocli atlas backups snapshots delete 5f4007f327a3bd7b6f4103c5 --clusterName myDemo

The command prints the following output to the terminal.

Snapshot '5f4006d29d52d968122ee664' deleted

Back

Watch a Backup Snapshot