AggregateFlow

class AggregateFlow<T : Any>(wrapped: AggregatePublisher<T>) : Flow<T>

Flow implementation for aggregate operations.

Parameters

T

The type of the result.

See also

Constructors

Link copied to clipboard
constructor(wrapped: AggregatePublisher<T>)

Functions

Link copied to clipboard
fun allowDiskUse(allowDiskUse: Boolean?): AggregateFlow<T>

Enables writing to temporary files. A null value indicates that it's unspecified.

Link copied to clipboard
fun batchSize(batchSize: Int): AggregateFlow<T>

Sets the number of documents to return per batch.

Link copied to clipboard
fun bypassDocumentValidation(bypassDocumentValidation: Boolean?): AggregateFlow<T>

Sets the bypass document level validation flag.

Link copied to clipboard
fun collation(collation: Collation?): AggregateFlow<T>

Sets the collation options

Link copied to clipboard
open suspend override fun collect(collector: FlowCollector<T>)
Link copied to clipboard
fun comment(comment: String?): AggregateFlow<T>
fun comment(comment: BsonValue?): AggregateFlow<T>

Sets the comment for this operation. A null value means no comment is set.

Link copied to clipboard
@JvmName(name = "explainDocument")
suspend fun explain(verbosity: ExplainVerbosity? = null): Document
inline suspend fun <R : Any> explain(verbosity: ExplainVerbosity? = null): R
suspend fun <R : Any> explain(resultClass: Class<R>, verbosity: ExplainVerbosity? = null): R

Explain the execution plan for this operation with the given verbosity level

Link copied to clipboard
fun hint(hint: Bson?): AggregateFlow<T>

Sets the hint for which index to use. A null value means no hint is set.

Link copied to clipboard

Sets the hint to apply.

Link copied to clipboard
fun let(variables: Bson?): AggregateFlow<T>

Add top-level variables to the aggregation.

Link copied to clipboard
fun maxAwaitTime(maxAwaitTime: Long, timeUnit: TimeUnit = TimeUnit.MILLISECONDS): AggregateFlow<T>

The maximum amount of time for the server to wait on new documents to satisfy a $changeStream aggregation.

Link copied to clipboard
fun maxTime(maxTime: Long, timeUnit: TimeUnit = TimeUnit.MILLISECONDS): AggregateFlow<T>

Sets the maximum execution time on the server for this operation.

Link copied to clipboard
suspend fun toCollection()

Aggregates documents according to the specified aggregation pipeline, which must end with a $out or $merge stage.