Accumulators
Functions
Creates an $accumulator pipeline stage
Gets a field name for a $group operation representing all unique values that results from applying the given expression to each document in a group of documents that share the same group by key.
Gets a field name for a $group operation representing the average of the values of the given expression when applied to all members of the group.
Returns a combination of a computed field and an accumulator that produces a value of the given {@code outExpression} computed for the bottom element within a group sorted according to the provided {@code sortBy} specification.
Returns a combination of a computed field and an accumulator that produces a BSON {@link org.bson.BsonType#ARRAY Array} of values of the given {@code outExpression} computed for the bottom {@code N} elements within a group sorted according to the provided {@code sortBy} specification, where {@code N} is the positive integral value of the {@code nExpression}.
Gets a field name for a $group operation representing the value of the given expression when applied to the first member of the group.
Returns a combination of a computed field and an accumulator that produces a BSON {@link org.bson.BsonType#ARRAY Array} of values of the given {@code inExpression} computed for the first {@code N} elements within a presorted group, where {@code N} is the positive integral value of the {@code nExpression}.
Gets a field name for a $group operation representing the value of the given expression when applied to the last member of the group.
Returns a combination of a computed field and an accumulator that produces a BSON {@link org.bson.BsonType#ARRAY Array} of values of the given {@code inExpression} computed for the last {@code N} elements within a presorted group, where {@code N} is the positive integral value of the {@code nExpression}.
Gets a field name for a $group operation representing the maximum of the values of the given expression when applied to all members of the group.
Returns a combination of a computed field and an accumulator that produces a BSON {@link org.bson.BsonType#ARRAY Array} of {@code N} largest values of the given {@code inExpression}, where {@code N} is the positive integral value of the {@code nExpression}.
Returns a combination of a computed field and an accumulator that generates a BSON {@link org.bson.BsonType#DOUBLE Double } representing the median value computed from the given {@code inExpression} within a group.
Gets a field name for a $group operation representing the result of merging the fields of the documents. If documents to merge include the same field name, the field, in the resulting document, has the value from the last document merged for the field.
Gets a field name for a $group operation representing the minimum of the values of the given expression when applied to all members of the group.
Returns a combination of a computed field and an accumulator that produces a BSON {@link org.bson.BsonType#ARRAY Array} of {@code N} smallest values of the given {@code inExpression}, where {@code N} is the positive integral value of the {@code nExpression}.
Returns a combination of a computed field and an accumulator that generates a BSON {@link org.bson.BsonType#ARRAY Array} containing computed values from the given {@code inExpression} based on the provided {@code pExpression}, which represents an array of percentiles of interest within a group, where each element is a numeric value between 0.0 and 1.0 (inclusive).
Gets a field name for a $group operation representing an array of all values that results from applying an expression to each document in a group of documents that share the same group by key.
Gets a field name for a $group operation representing the sample standard deviation of the values of the given expression when applied to all members of the group.
Gets a field name for a $group operation representing the sample standard deviation of the values of the given expression when applied to all members of the group.
Gets a field name for a $group operation representing the sum of the values of the given expression when applied to all members of the group.
Returns a combination of a computed field and an accumulator that produces a value of the given {@code outExpression} computed for the top element within a group sorted according to the provided {@code sortBy} specification.
Returns a combination of a computed field and an accumulator that produces a BSON {@link org.bson.BsonType#ARRAY Array} of values of the given {@code outExpression} computed for the top {@code N} elements within a group sorted according to the provided {@code sortBy} specification, where {@code N} is the positive integral value of the {@code nExpression}.