MongoDB MapReduce - Emit one key/one value doesnt call reduce

后端 未结 5 1808
情深已故
情深已故 2021-02-01 05:56

So i\'m new with mongodb and mapreduce in general and came across this "quirk" (or atleast in my mind a quirk)

Say I have objects in my collection like so:

5条回答
  •  长发绾君心
    2021-02-01 06:20

    "MongoDB will not call the reduce function for a key that has only a single value. The values argument is an array whose elements are the value objects that are “mapped” to the key."

    http://docs.mongodb.org/manual/reference/command/mapReduce/#mapreduce-reduce-cmd

提交回复
热议问题