Package dev.morphia.query
Class BucketOptions
- java.lang.Object
-
- dev.morphia.query.BucketOptions
-
public class BucketOptions extends java.lang.ObjectThe options for a bucket stage of aggregation pipeline.- Author:
- Roman Lapin
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classBucketOptions.OutputOperationDefines an output for bucketauto stage, that consists of the fieldname and the accumulator
-
Constructor Summary
Constructors Constructor Description BucketOptions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BucketOptionsdefaultField(java.lang.Object defaultField)Define default field for the bucket stagejava.util.Map<java.lang.String,Accumulator>getAccumulators()java.lang.ObjectgetDefaultField()BucketOptions.OutputOperationoutput(java.lang.String fieldName)Define output field for the bucket stagecom.mongodb.DBObjecttoDBObject()Converts a BucketOptions to a DBObject for use by the Java driver.
-
-
-
Method Detail
-
toDBObject
public com.mongodb.DBObject toDBObject()
Converts a BucketOptions to a DBObject for use by the Java driver.- Returns:
- the DBObject
-
defaultField
public BucketOptions defaultField(java.lang.Object defaultField)
Define default field for the bucket stage- Parameters:
defaultField- name of the field- Returns:
- this
-
output
public BucketOptions.OutputOperation output(java.lang.String fieldName)
Define output field for the bucket stage- Parameters:
fieldName- name of the output field- Returns:
- this
-
getDefaultField
public java.lang.Object getDefaultField()
- Returns:
- default bucket name
-
getAccumulators
public java.util.Map<java.lang.String,Accumulator> getAccumulators()
- Returns:
- output accumulators per output field
-
-