{ "_id": ObjectId(...), "item": "Banana", "category": ["food", "produce", "grocery"], "location": "4th Street Store", "stock": 4, "type": "cases", "arrival": Date(...) } 2 MongoDB imposes a limit of 31 fields for any compound index . 489 8.2. Index Concepts Important: You may not create compound indexes that have hashed index fields. You will receive an error if you attempt to create a compound index that includes a hashed index (page 502). The order of the fields in a compound index is very important. In the previous example, the index will contain references to documents sorted first by the values of the item field and, within each value of the item field, sorted by values of the stock field. See Sort Order (page 490) for more information. If applications query on the item field as well as query on both the item field and the stock field, you can specify a single compound index to support both of these queries: db.products.createIndex( { "item": 1, "stock": 1 } ) Consider a collection named products that holds documents that resemble the following document: Compound indexes can support queries that match on multiple fields. Example Compound Indexes db.factories.find( { metro: { state: "NY", city: "New York" } } ) See query-embedded-documents for more information regarding querying on embedded documents. MongoDB supports compound indexes , where a single index structure holds references to multiple fields 2 within a collection’s documents. The following diagram illustrates an example of a compound index on two fields: MongoDB Documentation, Release 3.0.4