Docs Menu

Docs HomeMongoDB Atlas

Create, View, and Drop Indexes

On this page

  • Required Roles
  • View Indexes
  • Create an Index
  • Drop an Index

You can use the Atlas CLI or the Atlas UI to manage indexes on your collections.

Indexes support the efficient execution of queries in MongoDB and should be considered for fields which your application reads often. To learn more about creating effective indexes, see Indexing Strategies.

To create or drop indexes, you must have access provided by at least one of the following roles:

From the Collections tab, you can view index information for a collection. To view index information for a collection:

1

The main panel and Namespaces on the left side list the collections in the database.

Screenshot highlighting databases in the Atlas UI.
2

The main panel displays the Find, Indexes, and Aggregation views.

3

The indexes table lists the indexes and associated index information for the collection. Index information includes the index definition, the size, and the usage frequency.

Screenshot highlighting index view in the Atlas UI.

Tip

When you create indexes, keep the ratio of reads to writes on the target collection in mind. Indexes come with a performance cost, but are more than worth the cost for frequent queries on large data sets. Before you create an index, review the documented indexing strategies.

Note

You can build full-text search with Atlas Search. Atlas Search offers fine-grained text indexing. To learn more, see Review Atlas Search Index Syntax.

To drop an index from a collection through the Atlas UI:

1

Select the collection whose index you wish to drop, and go to the Indexes tab.

2
3

Confirm by typing the name of the index, and click Drop.

Important

You cannot delete the _id index. To learn more, see Unique Indexes.

Note

Atlas CLI Limitation

You can't drop a cluster's index using the Atlas CLI.

←  Create, View, Update, and Delete DocumentsRun Aggregation Pipelines →
Share Feedback
© 2022 MongoDB, Inc.

About

  • Careers
  • Investor Relations
  • Legal Notices
  • Privacy Notices
  • Security Information
  • Trust Center
© 2022 MongoDB, Inc.