In MongoDB, if an index is on 3 fields, we can use that index when querying on 2 fields? (wildcard on the 3rd field)
问题 If there is an index on page_type, our_id, date and when querying, db.analytics.find({page_type: 'ingredients', ga_date: {$gte : new Date('Wed Sep 08 2010 12:00:00 GMT-0800')}}) db.analytics.find({page_type: 'ingredients', ga_date: {$gte : new Date('Wed Sep 08 2010 12:00:00 GMT-0800')}}).explain() if our_id is omitted, or date is omitted, it can still use the index, with something like the following in the explain() output: "our_id" : [ [ { "$minElement" : 1 }, { "$maxElement" : 1 } ] ], even