Tag Archives: map/reduce

MongoDB map/reduce

Map/reduce in MongoDB is quite difficult the get familiar with. In this post I’ll try to explain the basics with a real-life example.

Map/reduce can be used by calling this function with the following arguments

        out: collection,
        query: document,
        finalize: function
  • mapFunction, javascript function that will be explained below
  • reduceFunction, javascript function that will be explained below
  • out: name of the collection where the reduced data should be written to
  • query: query of the data where to apply the map/reduce on
  • finalize: function that is applied only once on the reduced data

Continue reading MongoDB map/reduce