Package com.mongodb
Class AggregationOptions.Builder
- java.lang.Object
 - 
- com.mongodb.AggregationOptions.Builder
 
 
- 
- Enclosing class:
 - AggregationOptions
 
@NotThreadSafe public static class AggregationOptions.Builder extends java.lang.Object
Builder for creatingAggregationOptions. 
- 
- 
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description AggregationOptions.BuilderallowDiskUse(java.lang.Boolean allowDiskUse)Set whether to enable external sort capabilities.AggregationOptions.BuilderbatchSize(java.lang.Integer size)Sets the size of batches to use when iterating over results.AggregationOptionsbuild()Return the options based on this builder.AggregationOptions.BuilderbypassDocumentValidation(java.lang.Boolean bypassDocumentValidation)Sets whether to bypass document validation.AggregationOptions.Buildercollation(Collation collation)Sets the collationAggregationOptions.BuildermaxTime(long maxTime, java.util.concurrent.TimeUnit timeUnit)Sets the maximum execution time for the aggregation command.AggregationOptions.BuilderoutputMode(AggregationOptions.OutputMode mode)Deprecated.There is no replacement for this. 
 - 
 
- 
- 
Method Detail
- 
batchSize
public AggregationOptions.Builder batchSize(java.lang.Integer size)
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:
 thisso calls can be chained
 
- 
allowDiskUse
public AggregationOptions.Builder allowDiskUse(java.lang.Boolean 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:
 thisso calls can be chained
 
- 
outputMode
@Deprecated public AggregationOptions.Builder outputMode(AggregationOptions.OutputMode mode)
Deprecated.There is no replacement for this. Applications can assume that the driver will use a cursor for server versions that support it (>= 2.6). The driver will ignore this as of MongoDB 3.6, which does not support inline results for the aggregate command.The mode of output for this configuration.- Parameters:
 mode- anOutputModethat defines how to output the results of the aggregation.- Returns:
 thisso calls can be chained- See Also:
 AggregationOptions.OutputMode
 
- 
maxTime
public AggregationOptions.Builder maxTime(long maxTime, java.util.concurrent.TimeUnit timeUnit)
Sets the maximum execution time for the aggregation command.- Parameters:
 maxTime- the max timetimeUnit- the time unit- Returns:
 thisso calls can be chained
 
- 
bypassDocumentValidation
public AggregationOptions.Builder bypassDocumentValidation(java.lang.Boolean bypassDocumentValidation)
Sets whether to bypass document validation.- Parameters:
 bypassDocumentValidation- whether to bypass document validation, or null if unspecified- Returns:
 - this
 - Since:
 - 2.14
 
 
- 
collation
public AggregationOptions.Builder collation(Collation collation)
Sets the collation- Parameters:
 collation- the collation- Returns:
 - this
 - Since:
 - 3.4
 
 
- 
build
public AggregationOptions build()
Return the options based on this builder.- Returns:
 - the aggregation options
 
 
 - 
 
 -