Accumulators calculate aggregated values like sums, maxima, and minima across a variable number of input values. You can use accumulators in these aggregation pipeline stages:
Name | Description |
|---|---|
Returns the result of a user-defined accumulator function. | |
Returns an array of unique expression values for each group. Order of the array elements is undefined. | |
Returns an average of numerical values. | |
Returns the bottom element within a group according to the specified sort order. | |
Returns an aggregation of the bottom | |
Returns a single array that combines the elements of two or more arrays. New in version 8.1. | |
Returns the number of documents in a group. Distinct from the | |
Returns the result of an expression for the first document in a group. | |
Returns an aggregation of the first | |
Returns the result of an expression for the last document in a group. | |
Returns the result of evaluating a specified expression over the last n elements in a group. | |
Returns the highest expression value for each group. | |
Returns an aggregation of the | |
Returns an approximation of the median (50th percentile) value of documents in a group. New in version 7.0. | |
Returns a document created by combining the input documents for each group. | |
Returns the lowest expression value for each group. | |
Returns an aggregation of the | |
Returns an array of scalar values that correspond to specified percentile values. New in version 7.0. | |
Returns an array of expression values for documents in each group. | |
Takes two or more arrays and returns an array containing the elements that appear in any input array. New in version 8.1. | |
Returns the population standard deviation of values from documents in a group. | |
Returns the sample standard deviation of values from documents in a group. | |
Returns a sum of numerical values. Ignores non-numeric values. | |
Returns the top element within a group according to the specified sort order. | |
Returns an aggregation of the top |