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.
Optional
onfinally: 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
Optional
partitionOptional
unit?: Appends a new $fill operator to this aggregate pipeline
Optional
partitionOptional
partitionOptional
sortAppends new custom $graphLookup operator(s) to this aggregate pipeline, performing a recursive search on a collection.
Optional
depthOptional
maxOptional
restrictAppends new custom $lookup operator to this aggregate pipeline.
Optional
foreignOptional
let?: Record<string, any>Optional
localOptional
pipeline?: (Appends a new $geoNear operator to this aggregate pipeline.
Optional
distanceOptional
includeOptional
key?: stringOptional
maxOptional
minOptional
num?: numberDeprecated. Use only with MondoDB below 4.2 (removed in 4.2)
Optional
query?: AnyObjectOptional
spherical?: booleanHelper for Atlas Text Search's
$search
stage.
Optional
highlight?: { Optional
maxOptional
maxOptional
index?: stringSets the session for this aggregation. Useful for transactions.
Appends new $unionWith operator to this aggregate pipeline.
Executes the query returning a
Promise
which will be resolved with either the doc(s) or rejected with the error. Like.then()
, but only takes a rejection handler.