Navigation

Manage Indexes in Data Explorer

You can use the Data Explorer to manage indexes on your collections.

To access the Data Explorer:

  1. Click Clusters in the top-left corner of Atlas.
  2. Click Collections for your desired cluster.

Or, if you are already viewing a specific cluster, select the Collections tab.

Required Roles

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

View Indexes

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

1

Select the database for the collection.

The main panel and the left-hand side displays the collections in the datatabse.

Screenshot highlighting databases in Data Explorer.
2

Select the collection on the left-hand side or in the main panel.

The main panel displays the Find view and the Indexes view.

3

Select the Indexes view.

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 Data Explorer.

Create an Index

To create an index for a collection through the Data Explorer:

1

Click the Indexes tab.

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

2

Click + Create Index.

In the Create Index modal, enter the index key specification document:

{ <field1>: <index type>, ... }

For example, to create a compound index on the fields category (ascending order) and score (descending order), specify the index specification document:

{ category: 1, score: -1 }

For more information on indexes, see Indexes.

3

(Optional) Specify the index options.

{ <option1>: <value1>, ... }

For example, the following options document specifies the unique option and the name for the index to create:

{ unique: true, name: "myUniqueIndex" }
4

(Optional) Set the Collation options.

Locale is the ICU Locale code for local languages. To review the list of locales that MongoDB collation supports, see the list of languages and locales. To learn more about collation options, including which are enabled by default for each locale, see Collation in the MongoDB manual.

5

(Optional) Enable building indexes in a rolling fashion.

Select Build index via rolling process.

Note

Data Explorer does not support building indexes with a rolling build for M0 Free Tier and M2/M5 shared clusters.

Building indexes this way reduces the performance impact of building indexes on replica sets and sharded clusters. To maintain cluster availability, Atlas removes one node from the cluster at a time starting with a secondary.

To learn more about rebuilding indexes, see Build Indexes on Replica Sets.

Note

The following index options are incompatible with building indexes in a rolling fashion:

Atlas ignores these options if you specify them in the Options pane.

6

Click Create.

For more information on creating indexes, see the MongoDB Manual.

7

In the Confirm Operation modal, confirm or reject your index.

Click Confirm to confirm, or click Cancel to cancel.

Drop an Index

To drop an index from a collection through the Data Explorer:

1

Go to the Indexes tab.

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

2

Click the Drop Index button for the index to drop.

3

Confirm action.

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

Note

You cannot delete the _id index.