Optional
onrejected: ((reason) => TResult | PromiseLike<TResult>)Optional
Executes the aggregation returning a Promise
which will be
resolved with .finally()
chained.
Optional
onfinally: (() => void)Optional
Provides promise for aggregate.
Optional
onfulfilled: ((value) => TResult1 | PromiseLike<TResult1>)Optional
Optional
onrejected: ((reason) => TResult2 | PromiseLike<TResult2>)Optional
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.
Sets an option on this aggregation. This function will be deprecated in a future release.
Appends new operators to this aggregate pipeline
Rest
...args: PipelineStage[]Rest
Set the collation.
Appends a new $densify operator to this aggregate pipeline
Optional
partitionOptional
unit?: "second" | "millisecond" | "minute" | "hour" | "day" | "week" | "month" | "quarter" | "year"Execute the aggregation with explain
Combines multiple aggregation pipelines.
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 $group operator to this aggregate pipeline.
Appends new custom $lookup operator to this aggregate pipeline.
Optional
foreignOptional
let?: Record<string, any>Optional
localOptional
pipeline?: (AddFields | Bucket | BucketAuto | mongoose.PipelineStage.CollStats | mongoose.PipelineStage.Count | Densify | Facet | Fill | GeoNear | GraphLookup | Group | IndexStats | Limit | ListSessions | Lookup | Match | PlanCacheStats | mongoose.PipelineStage.Project | Redact | ReplaceRoot | ReplaceWith | Sample | Search | SearchMeta | Set | SetWindowFields | Skip | mongoose.PipelineStage.Sort | SortByCount | UnionWith | Unset | Unwind)[]Appends a new custom $match operator to this aggregate pipeline.
$match operator contents
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?: booleanLets you set arbitrary options, for middlewares or plugins.
Returns the current pipeline
Appends a new $project operator to this aggregate pipeline.
Sets the readPreference option for the aggregation query.
Helper 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.
Generated using TypeDoc
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.