Package com.mongodb.client
Interface AggregateIterable<TResult>
- 
- Type Parameters:
 TResult- The type of the result.
- All Superinterfaces:
 Iterable<TResult>,MongoIterable<TResult>
public interface AggregateIterable<TResult> extends MongoIterable<TResult>
Iterable for aggregate.- Since:
 - 3.0
 - MongoDB documentation
 - Aggregation
 
 
- 
- 
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description AggregateIterable<TResult>allowDiskUse(Boolean allowDiskUse)Enables writing to temporary files.AggregateIterable<TResult>batchSize(int batchSize)Sets the number of documents to return per batch.AggregateIterable<TResult>bypassDocumentValidation(Boolean bypassDocumentValidation)Sets the bypass document level validation flag.AggregateIterable<TResult>collation(Collation collation)Sets the collation optionsAggregateIterable<TResult>comment(String comment)Sets the comment to the aggregation.AggregateIterable<TResult>hint(Bson hint)Sets the hint for which index to use.AggregateIterable<TResult>maxAwaitTime(long maxAwaitTime, TimeUnit timeUnit)The maximum amount of time for the server to wait on new documents to satisfy a$changeStreamaggregation.AggregateIterable<TResult>maxTime(long maxTime, TimeUnit timeUnit)Sets the maximum execution time on the server for this operation.voidtoCollection()Aggregates documents according to the specified aggregation pipeline, which must end with a $out or $merge stage.- 
Methods inherited from interface java.lang.Iterable
forEach, spliterator 
 - 
 
 - 
 
- 
- 
Method Detail
- 
toCollection
void toCollection()
Aggregates documents according to the specified aggregation pipeline, which must end with a $out or $merge stage.- Throws:
 IllegalStateException- if the pipeline does not end with a $out or $merge stage- Since:
 - 3.4
 - MongoDB documentation
 - $out stage
 - $merge stage
 
 
- 
allowDiskUse
AggregateIterable<TResult> allowDiskUse(@Nullable Boolean allowDiskUse)
Enables writing to temporary files. A null value indicates that it's unspecified.- Parameters:
 allowDiskUse- true if writing to temporary files is enabled- Returns:
 - this
 - MongoDB documentation
 - Aggregation
 
 
- 
batchSize
AggregateIterable<TResult> batchSize(int batchSize)
Sets the number of documents to return per batch.- Specified by:
 batchSizein interfaceMongoIterable<TResult>- Parameters:
 batchSize- the batch size- Returns:
 - this
 - MongoDB documentation
 - Batch Size
 
 
- 
maxTime
AggregateIterable<TResult> maxTime(long maxTime, TimeUnit timeUnit)
Sets the maximum execution time on the server for this operation.- Parameters:
 maxTime- the max timetimeUnit- the time unit, which may not be null- Returns:
 - this
 - MongoDB documentation
 - Max Time
 
 
- 
maxAwaitTime
AggregateIterable<TResult> maxAwaitTime(long maxAwaitTime, TimeUnit timeUnit)
The maximum amount of time for the server to wait on new documents to satisfy a$changeStreamaggregation. A zero value will be ignored.- Parameters:
 maxAwaitTime- the max await timetimeUnit- the time unit to return the result in- Returns:
 - the maximum await execution time in the given time unit
 - Since:
 - 3.6
 - Since server release
 - 3.6
 
 
- 
bypassDocumentValidation
AggregateIterable<TResult> bypassDocumentValidation(@Nullable Boolean bypassDocumentValidation)
Sets the bypass document level validation flag.Note: This only applies when an $out or $merge stage is specified
.- Parameters:
 bypassDocumentValidation- If true, allows the write to opt-out of document level validation.- Returns:
 - this
 - Since:
 - 3.2
 - MongoDB documentation
 - Aggregation
 - Since server release
 - 3.2
 
 
- 
collation
AggregateIterable<TResult> collation(@Nullable Collation collation)
Sets the collation optionsA null value represents the server default.
- Parameters:
 collation- the collation options to use- Returns:
 - this
 - Since:
 - 3.4
 - Since server release
 - 3.4
 
 
- 
comment
AggregateIterable<TResult> comment(@Nullable String comment)
Sets the comment to the aggregation. A null value means no comment is set.- Parameters:
 comment- the comment- Returns:
 - this
 - Since:
 - 3.6
 - Since server release
 - 3.6
 
 
- 
hint
AggregateIterable<TResult> hint(@Nullable Bson 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.6
 - Since server release
 - 3.6
 
 
 - 
 
 -