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.