Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/mongoose/types/expressions.d.ts>mongoose.Expression.Accumulator

MongoDB object modeling designed to work in an asynchronous environment.
Go to Latest
interface mongoose.Expression.Accumulator
import { type mongoose } from "https://deno.land/x/mongoose@8.6.4/types/expressions.d.ts";
const { Accumulator } = mongoose.Expression;

Properties

$accumulator: { init: CodeExpression; initArgs?: ArrayExpression; accumulate: CodeExpression; accumulateArgs: ArrayExpression; merge: CodeExpression; finalize?: CodeExpression; lang: "js"; }

Defines a custom accumulator operator. Accumulators are operators that maintain their state (e.g. totals, maximums, minimums, and related data) as documents progress through the pipeline. Use the $accumulator operator to execute your own JavaScript functions to implement behavior not supported by the MongoDB Query Language. See also $function.