Look at the image below

Yes, absolutely they are the labels of the blog posts. Do you have any idea how the labels are grouped together along with their counts? Which is commonly known as batch manipulation and aggregation of data.
If I'm a relational database user my answer would be like this,
But in the case of document oriented database like MongoDB, the tags will be stored as a String Array inside each post object. For example a post objects will look like
As you see, tags are not related to each other and two post objects can have redundant tags but, how do we group these tags?
It is a piece of cake through a tool called MapReduce. As the name indicates this includes two functions, Map and Reduce. To simplify we can say as,
Map function - emits each tag as a key, value pair.
In the above snippet,
this refers to the current post object and the
tags refers to the array of tags for that post.
Reduce function - receives the key and the value array, reduces the received values and eventually returns the result.
For more detailed info about these functions have a look at http://www.mongodb.org/display/DOCS/MapReduce.
Now let us see a sample code for illustration. The scenario is the same, there will be list of tasks and each task will have n number of tags and we have to group these tags with their count.
My tasks collection will look like the snippet below
The MapReduce class is written as,
Note : Here I had used MongoMapper, Mongo ORM for Ruby. To know more about MongoMapper, visit http://mongomapper.com/
You can also use, db = Mongo::Connection.new("localhost", 27017).db("mydb")
Used this Class to mapReduce tags as