Executes the aggregation returning a Promise which will be
resolved with .finally() chained.
Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The resolved value cannot be modified from the callback.
Optionalonfinally: null | (() => void)The callback to execute when the Promise is settled (fulfilled or rejected).
A Promise for the completion of the callback.
Provides promise for aggregate.
Attaches callbacks for the resolution and/or rejection of the Promise.
A Promise for the completion of which ever callback is executed.
Returns an asyncIterator for use with for/await/of loops
You do not need to call this function explicitly, the JavaScript runtime
will call it for you.
Appends a new $densify operator to this aggregate pipeline
OptionalpartitionOptionalunit?: Appends a new $fill operator to this aggregate pipeline
OptionalpartitionOptionalpartitionOptionalsortAppends new custom $graphLookup operator(s) to this aggregate pipeline, performing a recursive search on a collection.
OptionaldepthOptionalmaxOptionalrestrictAppends new custom $lookup operator to this aggregate pipeline.
OptionalforeignOptionallet?: Record<string, any>OptionallocalOptionalpipeline?: (Appends a new $geoNear operator to this aggregate pipeline.
OptionaldistanceOptionalincludeOptionalkey?: stringOptionalmaxOptionalminOptionalnum?: numberDeprecated. Use only with MondoDB below 4.2 (removed in 4.2)
Optionalquery?: AnyObjectOptionalspherical?: booleanHelper for Atlas Text Search's
$search stage.
Optionalhighlight?: { OptionalmaxOptionalmaxOptionalindex?: stringSets the session for this aggregation. Useful for transactions.
Appends new $unionWith operator to this aggregate pipeline.
Executes the query returning a
Promisewhich will be resolved with either the doc(s) or rejected with the error. Like.then(), but only takes a rejection handler.