Package dev.morphia.aggregation
Class Accumulator
- java.lang.Object
-
- dev.morphia.aggregation.Accumulator
-
public class Accumulator extends Object
Defines an accumulator for use in an aggregation pipeline.
-
-
Constructor Summary
Constructors Constructor Description Accumulator(String operation, Object field)
Defines an accumulator for use in an aggregation pipeline.Accumulator(String operation, String field)
Defines an accumulator for use in an aggregation pipeline.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Accumulator
accumulator(String operation, Object field)
Defines an accumulator for use in an aggregation pipeline.static Accumulator
accumulator(String operation, String field)
Defines an accumulator for use in an aggregation pipeline.String
getOperation()
Object
getValue()
org.bson.Document
toDocument()
-
-
-
Method Detail
-
accumulator
public static Accumulator accumulator(String operation, String field)
Defines an accumulator for use in an aggregation pipeline.- Parameters:
operation
- the accumulator operationfield
- the field to use- Returns:
- an Accumulator
-
accumulator
public static Accumulator accumulator(String operation, Object field)
Defines an accumulator for use in an aggregation pipeline.- Parameters:
operation
- the accumulator operationfield
- the field to use- Returns:
- an Accumulator
-
getOperation
public String getOperation()
- Returns:
- the operation for this accumulator
-
getValue
public Object getValue()
- Returns:
- the value for this accumulator
-
toDocument
public org.bson.Document toDocument()
-
-