public final class Accumulators extends Object
Modifier and Type | Method and Description |
---|---|
static <TExpression> |
addToSet(String fieldName,
TExpression expression)
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.
|
static <TExpression> |
avg(String fieldName,
TExpression expression)
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.
|
static <TExpression> |
first(String fieldName,
TExpression expression)
Gets a field name for a $group operation representing the value of the given expression when applied to the first member of
the group.
|
static <TExpression> |
last(String fieldName,
TExpression expression)
Gets a field name for a $group operation representing the value of the given expression when applied to the last member of
the group.
|
static <TExpression> |
max(String fieldName,
TExpression expression)
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.
|
static <TExpression> |
min(String fieldName,
TExpression expression)
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.
|
static <TExpression> |
push(String fieldName,
TExpression expression)
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.
|
static <TExpression> |
sum(String fieldName,
TExpression expression)
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.
|
public static <TExpression> BsonField sum(String fieldName, TExpression expression)
TExpression
- the expression typefieldName
- the field nameexpression
- the expressionpublic static <TExpression> BsonField avg(String fieldName, TExpression expression)
TExpression
- the expression typefieldName
- the field nameexpression
- the expressionpublic static <TExpression> BsonField first(String fieldName, TExpression expression)
TExpression
- the expression typefieldName
- the field nameexpression
- the expressionpublic static <TExpression> BsonField last(String fieldName, TExpression expression)
TExpression
- the expression typefieldName
- the field nameexpression
- the expressionpublic static <TExpression> BsonField max(String fieldName, TExpression expression)
TExpression
- the expression typefieldName
- the field nameexpression
- the expressionpublic static <TExpression> BsonField min(String fieldName, TExpression expression)
TExpression
- the expression typefieldName
- the field nameexpression
- the expressionpublic static <TExpression> BsonField push(String fieldName, TExpression expression)
TExpression
- the expression typefieldName
- the field nameexpression
- the expressionpublic static <TExpression> BsonField addToSet(String fieldName, TExpression expression)
TExpression
- the expression typefieldName
- the field nameexpression
- the expression