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

mongocli atlas cluster search index delete

On this page

  • Syntax
  • Options
  • Output
  • Examples

The search index delete command deletes an Atlas Search index. The command prompts you to confirm the operation when you run the command without the --force option.

You can also delete an Atlas Search index through the Atlas UI or API.

mongocli atlas cluster search|fts index delete <index-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?
<index-id>
string
Unique identifier of the Atlas Search index to delete.
yes
--clusterName
string
Name of the cluster.
yes
--force
flag
Flag that indicates that the Atlas Search index 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 public and private keys for the project are set. 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

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

Index '<index-id>' deleted

The following examples use the mongocli atlas cluster search index delete command to delete an Atlas Search index in the cluster named myTestCluster.

The following mongocli atlas cluster search index delete command deletes the Atlas Search index after prompting for a confirmation. It uses the default profile for accessing the Atlas project.

mongocli atlas cluster search index delete 5f2099cd683fc55fbb30bef6 --clusterName myTestCluster
Are you sure you want to delete: 5f2099cd683fc55fbb30bef6 Yes

The command prints the following to the terminal:

Index '5f2099cd683fc55fbb30bef6' deleted

The following mongocli atlas cluster search index delete command deletes the Atlas Search index without requiring confirmation. It uses the default profile for accessing the Atlas project.

mongocli atlas cluster search index delete 5f21d13ccbca3227d456bcc7 --clusterName myTestCluster --force

The command prints the following to the terminal:

Index '5f21d13ccbca3227d456bcc7' deleted

Back

Modify an Atlas Search Index