MongoDB Documentation, Release 3.0.4 • the stock field, or • the location and stock fields. If you have a collection that has both a compound index and an index on its prefix (e.g. { a: 1, b: 1 } and { a: 1 } ), if neither index has a sparse or unique constraint, then you can remove the index on the prefix (e.g. { a: 1 } ). MongoDB will use the compound index in all of the situations that it would have used the prefix index. Starting in version 2.6, MongoDB can use index intersection (page 510) to fulfill queries. The choice between creating compound indexes that support your queries or relying on index intersection depends on the specifics of your system. See Index Intersection and Compound Indexes (page 510) for more details. To index a field that holds an array value, MongoDB creates an index key for each element in the array. These multikey indexes support efficient queries against array fields. Multikey indexes can be constructed over arrays that hold both scalar values (e.g. strings, numbers) and nested documents. Index Intersection Multikey Indexes Create Multikey Index To create a multikey index, use the db.collection.createIndex() method: db.coll.createIndex( { <field>: < 1 or -1 > } ) MongoDB automatically creates a multikey index if any indexed field is an array; you do not need to explicitly specify the multikey type. 491 8.2. Index Concepts