TResult
- The type of the result.Iterable<TResult>
, MongoIterable<TResult>
public interface AggregateIterable<TResult> extends MongoIterable<TResult>
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 options
|
AggregateIterable<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
$changeStream aggregation. |
AggregateIterable<TResult> |
maxTime(long maxTime,
TimeUnit timeUnit) |
Sets the maximum execution time on the server for this operation.
|
void |
toCollection() |
Aggregates documents according to the specified aggregation pipeline, which must end with a $out stage.
|
AggregateIterable<TResult> |
useCursor(Boolean useCursor) |
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.
|
forEach, spliterator
void toCollection()
IllegalStateException
- if the pipeline does not end with a $out stageAggregateIterable<TResult> allowDiskUse(@Nullable Boolean allowDiskUse)
allowDiskUse
- true if writing to temporary files is enabledAggregateIterable<TResult> batchSize(int batchSize)
batchSize
in interface MongoIterable<TResult>
batchSize
- the batch sizeAggregateIterable<TResult> maxTime(long maxTime, TimeUnit timeUnit)
maxTime
- the max timetimeUnit
- the time unit, which may not be null@Deprecated AggregateIterable<TResult> useCursor(@Nullable Boolean useCursor)
useCursor
- whether the server should use a cursor to return resultsAggregateIterable<TResult> maxAwaitTime(long maxAwaitTime, TimeUnit timeUnit)
$changeStream
aggregation.
A zero value will be ignored.maxAwaitTime
- the max await timetimeUnit
- the time unit to return the result inAggregateIterable<TResult> bypassDocumentValidation(@Nullable Boolean bypassDocumentValidation)
Note: This only applies when an $out stage is specified
.bypassDocumentValidation
- If true, allows the write to opt-out of document level validation.AggregateIterable<TResult> collation(@Nullable Collation collation)
A null value represents the server default.
collation
- the collation options to useAggregateIterable<TResult> comment(@Nullable String comment)
comment
- the commentAggregateIterable<TResult> hint(@Nullable Bson hint)
hint
- the hint