Interface AggregatePublisher<TResult>
-
- Type Parameters:
TResult
- The type of the result.
- All Superinterfaces:
org.reactivestreams.Publisher<TResult>
public interface AggregatePublisher<TResult> extends org.reactivestreams.Publisher<TResult>
Publisher for aggregate.- Since:
- 1.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description AggregatePublisher<TResult>
allowDiskUse(Boolean allowDiskUse)
Enables writing to temporary files.AggregatePublisher<TResult>
batchSize(int batchSize)
Sets the number of documents to return per batch.AggregatePublisher<TResult>
bypassDocumentValidation(Boolean bypassDocumentValidation)
Sets the bypass document level validation flag.AggregatePublisher<TResult>
collation(Collation collation)
Sets the collation optionsAggregatePublisher<TResult>
comment(String comment)
Sets the comment to the aggregation.org.reactivestreams.Publisher<Document>
explain()
Explain the execution plan for this operation with the server's default verbosity levelorg.reactivestreams.Publisher<Document>
explain(ExplainVerbosity verbosity)
Explain the execution plan for this operation with the given verbosity level<E> org.reactivestreams.Publisher<E>
explain(Class<E> explainResultClass)
Explain the execution plan for this operation with the server's default verbosity level<E> org.reactivestreams.Publisher<E>
explain(Class<E> explainResultClass, ExplainVerbosity verbosity)
Explain the execution plan for this operation with the given verbosity levelorg.reactivestreams.Publisher<TResult>
first()
Helper to return a publisher limited to the first result.AggregatePublisher<TResult>
hint(Bson hint)
Sets the hint for which index to use.AggregatePublisher<TResult>
maxAwaitTime(long maxAwaitTime, TimeUnit timeUnit)
The maximum amount of time for the server to wait on new documents to satisfy a$changeStream
aggregation.AggregatePublisher<TResult>
maxTime(long maxTime, TimeUnit timeUnit)
Sets the maximum execution time on the server for this operation.org.reactivestreams.Publisher<Void>
toCollection()
Aggregates documents according to the specified aggregation pipeline, which must end with a $out stage.
-
-
-
Method Detail
-
allowDiskUse
AggregatePublisher<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
-
maxTime
AggregatePublisher<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
AggregatePublisher<TResult> maxAwaitTime(long maxAwaitTime, TimeUnit timeUnit)
The maximum amount of time for the server to wait on new documents to satisfy a$changeStream
aggregation. 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:
- 1.6
- Since server release
- 3.6
-
bypassDocumentValidation
AggregatePublisher<TResult> bypassDocumentValidation(@Nullable Boolean bypassDocumentValidation)
Sets the bypass document level validation flag.Note: This only applies when an $out stage is specified
.- Parameters:
bypassDocumentValidation
- If true, allows the write to opt-out of document level validation.- Returns:
- this
- Since:
- 1.2
- MongoDB documentation
- Aggregation
- Since server release
- 3.2
-
toCollection
org.reactivestreams.Publisher<Void> toCollection()
Aggregates documents according to the specified aggregation pipeline, which must end with a $out stage.- Returns:
- an empty publisher that indicates when the operation has completed
- MongoDB documentation
- Aggregation
-
collation
AggregatePublisher<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:
- 1.3
- Since server release
- 3.4
-
comment
AggregatePublisher<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:
- 1.7
- Since server release
- 3.6
-
hint
AggregatePublisher<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:
- 1.7
- Since server release
- 3.6
-
batchSize
AggregatePublisher<TResult> batchSize(int batchSize)
Sets the number of documents to return per batch.Overrides the
Subscription.request(long)
value for setting the batch size, allowing for fine grained control over the underlying cursor.- Parameters:
batchSize
- the batch size- Returns:
- this
- Since:
- 1.8
- MongoDB documentation
- Batch Size
-
first
org.reactivestreams.Publisher<TResult> first()
Helper to return a publisher limited to the first result.- Returns:
- a Publisher which will contain a single item.
- Since:
- 1.8
-
explain
org.reactivestreams.Publisher<Document> explain()
Explain the execution plan for this operation with the server's default verbosity level- Returns:
- the execution plan
- Since:
- 4.2
- MongoDB documentation
- reference/command/explain/
- Since server release
- 3.6
-
explain
org.reactivestreams.Publisher<Document> explain(ExplainVerbosity verbosity)
Explain the execution plan for this operation with the given verbosity level- Parameters:
verbosity
- the verbosity of the explanation- Returns:
- the execution plan
- Since:
- 4.2
- MongoDB documentation
- reference/command/explain/
- Since server release
- 3.6
-
explain
<E> org.reactivestreams.Publisher<E> explain(Class<E> explainResultClass)
Explain the execution plan for this operation with the server's default verbosity level- Type Parameters:
E
- the type of the document class- Parameters:
explainResultClass
- the document class to decode into- Returns:
- the execution plan
- Since:
- 4.2
- MongoDB documentation
- reference/command/explain/
- Since server release
- 3.6
-
explain
<E> org.reactivestreams.Publisher<E> explain(Class<E> explainResultClass, ExplainVerbosity verbosity)
Explain the execution plan for this operation with the given verbosity level- Type Parameters:
E
- the type of the document class- Parameters:
explainResultClass
- the document class to decode intoverbosity
- the verbosity of the explanation- Returns:
- the execution plan
- Since:
- 4.2
- MongoDB documentation
- reference/command/explain/
- Since server release
- 3.6
-
-