Answer the question
In order to leave comments, you need to log in
Why does count take a long time in mongo on a field with an index?
Initial data:
Collection of 2,000,000 records
Unit field has an index {"unit" : 1.0}
Problem:
Query
db.getCollection('CollectionName').find({"unit":"value"}).count()
db.getCollection('CollectionName').find({"unit":"value"})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question