Exiting the map / abbreviation MongoDB includes something like 'counts': {'input': I, 'emit': E, 'output': O}. I thought that I clearly understand what this means until I get into a strange case that I cannot explain.
In my opinion, counts.inputthis is the number of lines that match the condition (as indicated in query). If so, how is it possible that the following two queries have different results?
db.mycollection.find({MY_CONDITION}).count()
db.mycollection.mapReduce(SOME_MAP, SOME_REDUCE, {'query': {MY_CONDITION}}).counts.input
I thought that they should always give the same result, regardless of the map, and reduce functions if the same condition is used.
source
share