I believe the reduce number is the number of times the reduce function was called, as you suggest. It is different because the reduce is called with groups of emits. The map/reduce algorithm may not get all of the emits for a particular key before it calls the reduce function. If may call reduce on a batch of 20 it finds early in processing. Near the end of the processing, it may find another two. In this case, it's going to call reduce on the previous results of the 20, and the two new values.Your reduce algorithm determines what the output will be. Normally, this is smaller. I'm guessing that what you think your algorithm is doing isn't actually right. It looks like you are trying to count something and store it in an object. The problem is that you are overwriting the previous values. In the scenario above, you might expect a count of 22, but your result object would be { key: 3 }. If you aren't getting the results you are expecting, can you provide a sample of relevant data, you map function, and what you are trying to do?
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com
To unsubscribe from this group, send email to
mongodb-user...@googlegroups.com
See also the IRC channel -- freenode.net#mongodb