db.thedates.save({ thedate:new Date() })
db.thedates.aggregate({ $project:{ year:{$year:["$thedate"]} , month:{$month:["$thedate"]} , day:{$dayOfMonth:["$thedate"]} } })
or possibly this if you're trying to group/count by day?
db.thedates.drop()
db.thedates.save({id:1, thedate:new Date('03 March 2012 03:00:00')})
db.thedates.save({id:2, thedate:new Date('03 March 2012 04:00:00')})
db.thedates.save({id:3, thedate:new Date('04 March 2012 03:00:00')})
db.thedates.save({id:4, thedate:new Date('05 March 2012 03:00:00')})
db.thedates.aggregate(
{ $project:{ year:{$year:["$thedate"]} , month:{$month:["$thedate"]} , day:{$dayOfMonth:["$thedate"]} } },
{ $group: { _id:{year:"$year", month:"$month", day:"$day"}, thecount:{$sum:1}}}
)