I have following documents in my collection
{
"_id": ObjectId("54490b8104f7142f22ecc97f"),
"title": "Sample1",
"slug": "samplenews",
"cat": "sports",
"desc": "sampletextsampletext",
"published_date": ISODate("2014-10-23T14:06:57.0Z"),
} {
"_id": ObjectId("54490b8104f7142f22ecc97f"),
"title": "Sample2",
"slug": "samplenews2",
"category": "entertaintment",
"desc": "sampletextsampletext",
"published_date": ISODate("2014-10-22T14:06:57.0Z"),
} {
"_id": ObjectId("54490b8104f7142f22ecc97f"),
"title": "Sample3",
"slug": "samplenews3",
"category": "entertaintment",
"desc": "sampletextsampletext",
"published_date": ISODate("2014-9-22T14:06:57.0Z"),
} {
"_id": ObjectId("54490b8104f7142f22ecc97f"),
"title": "Sample4",
"slug": "samplenews4",
"category": "other",
"desc": "sampletextsampletext",
"published_date": ISODate("2014-10-22T14:06:57.0Z"),
}
I need one query to get top 5 latest news from each category.any suggestions?