Skip to content

CoroutineMongoAggregateIterable

Streaming-capable iterable cursor to read data from the database.

The Coroutine client provides a coroutine-aware API which internally uses the official Kotlin driver.

This type wraps a AggregateFlow from the official driver. See also CoroutineMongoFindIterable.

External resources

Functions

asFlow

abstract fun asFlow(): Flow<Document>

asOfficial

abstract fun asOfficial(): AggregateFlow<Document>

Obtains the underlying MongoDB flow from the official Kotlin driver.

asSequence

first

abstract suspend fun first(): Document

firstOrNull

abstract suspend fun firstOrNull(): Document?

forEach

abstract suspend fun forEach(action: suspend (Document) -> Unit)

toList

open suspend fun toList(): List<Document>

toSequence

toSet

open suspend fun toSet(): Set<Document>