MongoDB - Index not being used when sorting and limiting on ranged query
问题 I'm trying to get a sorted list of items using a ranged query on a collection containing bulletin-board data. The data structure of a "thread" document is: { "_id" : ObjectId("5a779b47f4fa72412126526a"), "title" : "necessitatibus tincidunt libris assueverit", "content" : "Corrumpitvenenatis cubilia adipiscing sollicitudin", "flagged" : false, "locked" : false, "sticky" : false, "lastPostAt" : ISODate("2018-02-05T06:35:24.656Z"), "postCount" : 42, "user" : ObjectId("5a779b46f4fa72412126525a"),