I have a MongoDB collection which has a created_at stored in each document. These are stored as a MongoDB date object e.g.
{ "_id" : "4cacda7eed607e095201df00", "created_at" : "Wed Oct 06 2010 21:22:23 GMT+0100 (BST)", text: "something" }
{ "_id" : "4cacdf31ed607e0952031b70", "created_at" : "Wed Oct 06 2010 21:23:42 GMT+0100 (BST)", text: "something" }
....
I would like to count the number of items created between each minute, so I can pass the data into Google Charts to generate something like this:

How do I do this with a map reduce function, or is there a fancy MongoDB aggregate function which I could use instead?
Map function should emit a timestamp object, adjusted up to the minute, and a count of 1. The reduce function should sum all the counts: