MongoDB provides us with a
mapReduce command and in the following figure, we can observe the life circle of the MapReduce process in MongoDB. We start with a Collection or a query and each document in the collection will call the
map function. Then, using the
emit function we will create an intermediate hash map (See the following figure) with a list of pairs (key-value). Next, the
You can find the reference documentation of MapReduce with MongoDB at http://docs.mongodb.org/manual/core/map-reduce/.