Package dev.morphia.query
Class BucketAutoOptions.OutputOperation
- java.lang.Object
-
- dev.morphia.query.BucketAutoOptions.OutputOperation
-
- Enclosing class:
- BucketAutoOptions
public class BucketAutoOptions.OutputOperation extends java.lang.Object
Defines an output for bucketauto stage, that consists of the fieldname and the accumulator
-
-
Constructor Summary
Constructors Constructor Description OutputOperation(java.lang.String fieldName)
Creates the output operation for given fieldname
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BucketAutoOptions
addToSet(java.lang.String field)
Returns an array of all unique values that results from applying an expression to each document in a group of documents that share the same group by key.BucketAutoOptions
average(java.lang.String field)
Returns the average value of the numeric values that result from applying a specified expression to each document in a group of documents that share the same group by key.BucketAutoOptions
sum(java.lang.Object field)
Calculates and returns the sum of all the numeric values that result from applying a specified expression to each document in a group of documents that share the same group by key.
-
-
-
Method Detail
-
addToSet
public BucketAutoOptions addToSet(java.lang.String field)
Returns an array of all unique values that results from applying an expression to each document in a group of documents that share the same group by key. Order of the elements in the output array is unspecified.- Parameters:
field
- the field to process- Returns:
- an Accumulator
- MongoDB documentation
- reference/operator/aggregation/addToSet $addToSet
-
average
public BucketAutoOptions average(java.lang.String field)
Returns the average value of the numeric values that result from applying a specified expression to each document in a group of documents that share the same group by key. $avg ignores non-numeric values.- Parameters:
field
- the field to process- Returns:
- an Accumulator
- MongoDB documentation
- reference/operator/aggregation/avg $avg
-
sum
public BucketAutoOptions sum(java.lang.Object field)
Calculates and returns the sum of all the numeric values that result from applying a specified expression to each document in a group of documents that share the same group by key. $sum ignores non-numeric values.- Parameters:
field
- the field to process- Returns:
- an Accumulator
- MongoDB documentation
- reference/operator/aggregation/sum $sum
-
-