I have a \"status\" collection like this strcture -
{ _id: ObjectId(\"545a0b63b03dbcd1238b4567\"), status: 1004, comment: \"Rem dolor ipsam place
A little more beautiful for mongo db.version() < 3.0
db.collection.aggregate([ {$match: {created_at:{$exists:1}}}, {$group: { _id: {$add:[ {$dayOfYear: "$created_at" }, {$multiply: [{$year: "$created_at"}, 1000]} ]}, count: {$sum: 1 } }}, {$sort:{_id:-1}} ])