MongoCollection.aggregate

Bson aggregate(ARGS...)(ARGS pipeline) @safe

Calculates aggregate values for the data in a collection.

Parameters

pipelineA sequence of data aggregation processes. These can either be given as separate parameters, or as a single array parameter.

Returns

Returns the list of documents aggregated by the pipeline. The return

value is either a single Bson array value or a MongoCursor (input range) of the requested document type.

Throws

Exception if a DB communication error occurred.

See Also

MongoCursor!R aggregate(R = Bson, S = Bson)(S[] pipeline, AggregateOptions options) @safe

ditto