object Accumulator
- Companion
- class
class Object
trait Matchable
class Any
Value members
Concrete methods
def apply(fieldName: String, initFunction: String, accumulateFunction: String, mergeFunction: String, initArgs: List[String], accumulateArgs: List[String], finalizeFunction: Option[String], lang: String): Accumulator
Creates an $accumulator pipeline stage
Creates an $accumulator pipeline stage
- Value Params
- accumulateArgs
additional accumulate function’s arguments. The first argument to the function is ‘state’.
- accumulateFunction
a function used to accumulate documents
- fieldName
the field name
- finalizeFunction
a function used to finalize the state and return the result
- initArgs
init function’s arguments
- initFunction
a function used to initialize the state
- lang
a language specifier
- mergeFunction
a function used to merge two internal states, e.g. accumulated on different shards or threads. It returns the resulting state of the accumulator.
- Returns
the $accumulator pipeline stage https://docs.mongodb.com/manual/reference/operator/aggregation/accumulator/
- Since
4.1