This version will reach end of life on Feb 2018. To upgrade, go to the Learn more about upgrading your version of MongoDB.

Index Concepts

On this page

These documents describe and provide examples of the types, configuration options, and behavior of indexes in MongoDB. For an overview of indexing, see Index Introduction. For operational instructions, see Indexing Tutorials. The Indexing Reference documents the commands and operations specific to index construction, maintenance, and querying in MongoDB, including index types and creation options.

Index Types

MongoDB provides different types of indexes for different purposes and different types of content.

Single Field Indexes
A single field index only includes data from a single field of the documents in a collection. MongoDB supports single field indexes on fields at the top level of a document and on fields in sub-documents.
Compound Indexes
A compound index includes more than one field of the documents in a collection.
Multikey Indexes
A multikey index is an index on an array field, adding an index key for each value in the array.
Geospatial Indexes and Queries
Geospatial indexes support location-based searches on data that is stored as either GeoJSON objects or legacy coordinate pairs.
Text Indexes
Text indexes support search of string content in documents.
Hashed Index
Hashed indexes maintain entries with hashes of the values of the indexed field and are primarily used with sharded clusters to support hashed shard keys.
Index Properties

The properties you can specify when building indexes.

TTL Indexes
The TTL index is used for TTL collections, which expire data after a period of time.
Unique Indexes
A unique index causes MongoDB to reject all documents that contain a duplicate value for the indexed field.
Sparse Indexes
A sparse index does not index documents that do not have the indexed field.
Index Creation
The options available when creating indexes.
Index Intersection
The use of index intersection to fulfill a query.
Multikey Index Bounds
The computation of bounds on a multikey index scan.

Additional Resources