Map-reduce is a method of performing aggregation.
* Map function emits key-value pair specified.
* Reduce function combines the key value pair and returns the aggregation result.
Syntax :
db.collection.mapReduce(
function() {emit(key,value);},
function(key, values) {return aggregatedResult}, { out: collection }
</pre.
)