Package com.mongodb
Class AggregationOptions.Builder
java.lang.Object
com.mongodb.AggregationOptions.Builder
- Enclosing class:
- AggregationOptions
Builder for creating
AggregationOptions
.-
Method Summary
Modifier and TypeMethodDescriptionallowDiskUse
(Boolean allowDiskUse) Set whether to enable external sort capabilities.Sets the size of batches to use when iterating over results.build()
Return the options based on this builder.bypassDocumentValidation
(Boolean bypassDocumentValidation) Sets whether to bypass document validation.Sets the collationSets the maximum execution time for the aggregation command.
-
Method Details
-
batchSize
Sets the size of batches to use when iterating over results. Can be null.- Parameters:
size
- the batch size to apply to the cursor- Returns:
this
so calls can be chained
-
allowDiskUse
Set whether to enable external sort capabilities. If set to false, $sort produces an error if the operation consumes 10 percent or more RAM.- Parameters:
allowDiskUse
- whether or not aggregation stages can write data to temporary files- Returns:
this
so calls can be chained
-
maxTime
Sets the maximum execution time for the aggregation command.- Parameters:
maxTime
- the max timetimeUnit
- the time unit- Returns:
this
so calls can be chained
-
bypassDocumentValidation
public AggregationOptions.Builder bypassDocumentValidation(@Nullable Boolean bypassDocumentValidation) Sets whether to bypass document validation.- Parameters:
bypassDocumentValidation
- whether to bypass document validation, or null if unspecified- Returns:
- this
- Since:
- 2.14
- Since server release
- 3.2
-
collation
Sets the collation- Parameters:
collation
- the collation- Returns:
- this
- Since:
- 3.4
- Since server release
- 3.4
-
build
Return the options based on this builder.- Returns:
- the aggregation options
-