MongoDB Documentation, Release 3.0.4 Index Bounds Limitations Examples db.survey.createIndex( { ratings: 1 } ) Create an index on the field ratings : { _id: 1, item: "ABC", ratings: [ 2, 5, 9 ] } Index Basic Arrays Consider a survey collection with the following document: Since the ratings field contains an array, the index on ratings is multikey. The multikey index contains the following three index keys, each pointing to the same document: Hashed Indexes Hashed (page 502) indexes cannot be multikey. Changed in version 2.6: However, if the shard key index is a prefix (page 490) of a compound index, the compound index is allowed to become a compound multikey index if one of the other keys (i.e. keys that are not part of the shard key) indexes an array. Compound multikey indexes can have an impact on performance. Shard Keys You cannot specify a multikey index as the shard key index. A compound multikey index { a: 1, b: 1 } is permissible since for each document, only one field indexed by the compound multikey index is an array; i.e. no document contains array values for both a and b fields. After creating the compound multikey index, if you attempt to insert a document where both a and b fields are arrays, MongoDB will fail the insert. { _id: 1, a: [1, 2], b: 1, category: "A array" } { _id: 2, a: 1, b: [1, 2], category: "B array" } But consider a collection that contains the following documents: You cannot create a compound multikey index { a: 1, b: 1 } on the collection since both the a and b fields are arrays. { _id: 1, a: [ 1, 2 ], b: [ 1, 2 ], category: "AB - both arrays" } For example, consider a collection that contains the following document: Compound Multikey Indexes For a compound (page 489) multikey index, each indexed document can have at most one indexed field whose value is an array. As such, you cannot create a compound multikey index if more than one to-be-indexed field of a document is an array. Or, if a compound multikey index already exists, you cannot insert a document that would violate this restriction. If an index is multikey, then computation of the index bounds follows special rules. For details on multikey index bounds, see Multikey Index Bounds (page 511). • 2 , • 5 , and • 9 . Chapter 8. Indexes 492