meteor-feature-requests
meteor-feature-requests copied to clipboard
Minimongo queries including _id: { $in: list } should iterate over the list instead of COLLSCAN
Currently Minimongo does what MongoDB's query optimizer would call a COLLSCAN (i.e. iterating over the full collection) when the query document isn't a string and doesn't contain a _id key whose value is a string. However, when the query contains an _id key whose value is a document with $in: , the query can be executed more efficiently by iterating over the list, looking up documents from the collection, then (if necessary) checking whether the rest of the query matches the document. As potentially an added bonus, the results would by default be in the same order as the list in the $in clause.