, | Array | Array [ Array , ] aggregate ( ) {
Locally apply a MongoDB aggregation pipeline. Does not affect the input documents. Optionally returns the results of each individual stage as well as the final result.
Arguments
|
Array
[
Object
,
]
pipeline
An Array of stage operator specifications used to select/modify the source documents.
optional
|
Boolean
keepStages
If true, the return value is an Array containing each Array of results produced by each stage. Otherwise the return value is the final result Array.