Skip to content

SyncMongoFindIterable

interface SyncMongoFindIterable<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 FindFlow from the official driver. See also SyncMongoAggregateIterable.

External resources

Functions

asOfficial

abstract fun asOfficial(): FindIterable<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>