Skip to content

SyncMongoAggregateIterable

interface SyncMongoAggregateIterable<Document : Any> : MongoIterable<Document> 

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 SyncMongoFindIterable.

External resources

Functions

asOfficial

abstract fun asOfficial(): AggregateIterable<Document>

Obtains the underlying MongoDB flow from the official Kotlin driver.

asSequence

first

abstract fun first(): Document

firstOrNull

abstract fun firstOrNull(): Document?

forEach

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

toList

open fun toList(): List<Document>

toSequence

toSet

open fun toSet(): Set<Document>