Mongo.Repo.aggregate
You're seeing just the callback
aggregate
, go back to Mongo.Repo module for more information.
Specs
aggregate(module :: module(), pipeline :: BSON.document(), opts :: Keyword.t()) :: [ Mongo.Collection.t() ]
Performs aggregation operation using the aggregation pipeline on the given collection module and returns a list of collection structs.
For all options see Options
Example
MyApp.Repo.aggregate(Post, [
%{"$match" => %{title: title}},
%{"$sort" => [{"title", -1}]},
%{"$limit" => 10}
])