I have a MongoDB collection that stores created_atin every document. They are saved as a MongoDB date object, for example.
{ "_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 every minute, so I can pass the data to Google Charts to create something like this:

How can I do this using the map reduction function, or is there some kind of moral MongoDB function that I could use instead?
source
share