-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
Currently, aggregation is only available on the collection, and query has to be added manually:
selector = Band.where(name: "Depeche Mode").query.selector Band.collection.aggregate([{"$match"=> selector}, ...])
With this PR, #aggregation will be available on queries and will take selector into account:
Band.where(name: "Depeche Mode").aggregate({"$sort" => { "likes" => -1}})
(Having to write aggregate pipeline manually isn't that awesome though, I might try to implement a nicer DSL for that later.)