Accumulator

mongo4cats.operations.Accumulator
See theAccumulator companion trait
object Accumulator

Attributes

Companion
trait
Graph
Supertypes
trait AsJavaConverters
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def addToSet[T](fieldName: String, expression: T): Accumulator
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 parameters

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.

Attributes

Returns

the $accumulator pipeline stage https://docs.mongodb.com/manual/reference/operator/aggregation/accumulator/

Since

4.1

def avg[T](fieldName: String, expression: T): Accumulator
def first[T](fieldName: String, expression: T): Accumulator
def last[T](fieldName: String, expression: T): Accumulator
def max[T](fieldName: String, expression: T): Accumulator
def min[T](fieldName: String, expression: T): Accumulator
def push[T](fieldName: String, expression: T): Accumulator
def stdDevPop[T](fieldName: String, expression: T): Accumulator
def stdDevSamp[T](fieldName: String, expression: T): Accumulator
def sum[T](fieldName: String, expression: T): Accumulator

Inherited methods

def asJava[K, V](m: Map[K, V]): ConcurrentMap[K, V]

Attributes

Inherited from:
AsJavaConverters
def asJava[K, V](m: Map[K, V]): Map[K, V]

Attributes

Inherited from:
AsJavaConverters
def asJava[K, V](m: Map[K, V]): Map[K, V]

Attributes

Inherited from:
AsJavaConverters
def asJava[A](s: Set[A]): Set[A]

Attributes

Inherited from:
AsJavaConverters
def asJava[A](s: Set[A]): Set[A]

Attributes

Inherited from:
AsJavaConverters
def asJava[A](s: Seq[A]): List[A]

Attributes

Inherited from:
AsJavaConverters
def asJava[A](s: Seq[A]): List[A]

Attributes

Inherited from:
AsJavaConverters
def asJava[A](b: Buffer[A]): List[A]

Attributes

Inherited from:
AsJavaConverters
def asJava[A](i: Iterable[A]): Iterable[A]

Attributes

Inherited from:
AsJavaConverters
def asJava[A](i: Iterator[A]): Iterator[A]

Attributes

Inherited from:
AsJavaConverters
def asJavaCollection[A](i: Iterable[A]): Collection[A]

Attributes

Inherited from:
AsJavaConverters
def asJavaDictionary[K, V](m: Map[K, V]): Dictionary[K, V]

Attributes

Inherited from:
AsJavaConverters
def asJavaEnumeration[A](i: Iterator[A]): Enumeration[A]

Attributes

Inherited from:
AsJavaConverters