how to query group by and distinct with a limit in MongoDB PHP codeigniter?
问题 Is such a operation possible? sample record: { _id: ObjectId("51d6be147483c58419000002"), user: "ashok", action: "login", time: 1373027860, details: { user_entries: "blah..blah", url: "web.domain.com" } } Suppose, i want to group by url visited, for each user, group by url where user = "ashok", limit 10. I am using AlexBilbie library for MongoDB-Codeigniter (it doesnt have aggregation). so using plain php. Still even if I could aggregate, how to distinct or limit it? Any suggestion is welcome