MongoDB 3.0.3
These two lines end in less than a second.
db.documents.count({'docType': 'fcsNotificationEF'});
db.documents.count({'docType': 'fcsNotificationZK'});
And it didn’t end in a minute
db.documents.count({'docType': {$in: ['fcsNotificationEF', 'fcsNotificationZK']}})
I have an index for docType. As I understand it, this line from the output db.currentOpconfirms that the index is being used:
"planSummary": "IXSCAN { docType: 1.0 }"
This workaround did not end in a minute.
source
share