Package dev.morphia.aggregation
Class AggregationOptions
java.lang.Object
dev.morphia.aggregation.AggregationOptions
- All Implemented Interfaces:
dev.morphia.internal.CollectionConfigurable<AggregationOptions>
,dev.morphia.internal.CollectionConfiguration
,dev.morphia.internal.ReadConfigurable<AggregationOptions>
,dev.morphia.internal.WriteConfigurable<AggregationOptions>
public class AggregationOptions
extends Object
implements dev.morphia.internal.ReadConfigurable<AggregationOptions>, dev.morphia.internal.WriteConfigurable<AggregationOptions>, dev.morphia.internal.CollectionConfigurable<AggregationOptions>
Defines options to be applied to an aggregation pipeline.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionallowDiskUse
(boolean allowDiskUse) Enables writing to temporary files.batchSize
(int batchSize) Sets the batch size for fetching results.bypassDocumentValidation
(boolean bypassDocumentValidation) Enables the aggregation to bypass document validation during the operation.Specifies the collation to use for the operation.collection
(String collection) Specify an alternate collection to aggregate from rather than the collection mapped to the type used to create the aggregation initially.Sets the comment for this operation.Sets the hint for which index to use.Sets the hint for which index to use.Defines any variables to use when evaluating the pipelinemaxAwaitTime
(long maxTime, TimeUnit timeUnit) Specifies a time limit for processing operations on a cursor.Specifies a time limit for processing operations on a cursor.maxTimeMS
(long maxTimeMS) Specifies a time limit in milliseconds for processing operations on a cursor.readConcern
(ReadConcern readConcern) Specifies the read concern.readPreference
(ReadPreference readPreference) Sets the read preference to usetimeoutMode
(TimeoutMode timeoutMode) Sets the timeout modewriteConcern
(WriteConcern writeConcern) Sets the write concern to use
-
Constructor Details
-
AggregationOptions
public AggregationOptions()
-
-
Method Details
-
allowDiskUse
Enables writing to temporary files.- Parameters:
allowDiskUse
- true to enable- Returns:
- this
-
batchSize
Sets the batch size for fetching results.- Parameters:
batchSize
- the size- Returns:
- this
-
bypassDocumentValidation
Enables the aggregation to bypass document validation during the operation. This lets you insert documents that do not meet the validation requirements.Applicable only if you specify the $out or $merge aggregation stages.
- Parameters:
bypassDocumentValidation
- true to enable the bypass- Returns:
- this
-
collation
Specifies the collation to use for the operation.Collation allows users to specify language-specific rules for string comparison, such as rules for letter case and accent marks.
- Parameters:
collation
- the collation to use- Returns:
- this
-
collection
Specify an alternate collection to aggregate from rather than the collection mapped to the type used to create the aggregation initially.- Specified by:
collection
in interfacedev.morphia.internal.CollectionConfigurable<AggregationOptions>
- Parameters:
collection
- the name of the collection to use- Returns:
- this
- Since:
- 2.3
-
comment
Sets the comment for this operation. A null value means no comment is set.- Parameters:
comment
- the comment- Returns:
- this
- Since:
- 3.0
- Since server release
- 3.6
-
hint
Sets the hint for which index to use. A null value means no hint is set.- Parameters:
hint
- the hint- Returns:
- this
- Since server release
- 3.6
-
hint
Sets the hint for which index to use. A null value means no hint is set.- Parameters:
hint
- the hint- Returns:
- this
- Since:
- 3.0
- Since server release
- 3.6
-
let
Defines any variables to use when evaluating the pipeline- Parameters:
let
- the variable definitions- Returns:
- this
- Since:
- 3.0
-
maxTimeMS
Specifies a time limit in milliseconds for processing operations on a cursor. If you do not specify a value for maxTimeMS, operations will not time out. A value of 0 explicitly specifies the default unbounded behavior.- Parameters:
maxTimeMS
- the max time in milliseconds- Returns:
- this
-
maxTime
Specifies a time limit for processing operations on a cursor. If you do not specify a value for maxTime, operations will not time out. A value of 0 explicitly specifies the default unbounded behavior.- Parameters:
maxTime
- the max timetimeUnit
- the time unit- Returns:
- this
- Since:
- 3.0
-
maxAwaitTime
Specifies a time limit for processing operations on a cursor. If you do not specify a value for maxTime, operations will not time out. A value of 0 explicitly specifies the default unbounded behavior.- Parameters:
maxTime
- the max timetimeUnit
- the time unit- Returns:
- this
- Since:
- 3.0
-
readConcern
Specifies the read concern.- Specified by:
readConcern
in interfacedev.morphia.internal.ReadConfigurable<AggregationOptions>
- Parameters:
readConcern
- the read concern to use- Returns:
- this
-
readPreference
Sets the read preference to use- Specified by:
readPreference
in interfacedev.morphia.internal.ReadConfigurable<AggregationOptions>
- Parameters:
readPreference
- the read preference- Returns:
- this
-
timeoutMode
Sets the timeout mode- Parameters:
timeoutMode
- the timeout mode- Returns:
- this
- Since:
- 3.0
-
writeConcern
Sets the write concern to use- Specified by:
writeConcern
in interfacedev.morphia.internal.WriteConfigurable<AggregationOptions>
- Parameters:
writeConcern
- the write concern- Returns:
- this
-