Skip to content

MongoDB driver for Kotlin (synchronous)opensavvy.ktmongo.syncMongoIterable

MongoIterable

interface MongoIterable<Document : Any>

Streaming-ready iterable client to read data from the database.

Inheritors

  • JvmMongoIterable

Functions

asSequence

open fun asSequence(): <Document>

first

open fun first(): Document

Returns the first document found by this query, or throws an exception.

firstOrNull

abstract fun firstOrNull(): Document?

Returns the first document found by this query, or null if none were found.

forEach

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

Executes action for each document returned by this query.

toList

open fun toList(): List<Document>

Reads the entirety of this response into a List.

toSequence

open fun toSequence(): <Document>

toSet

open fun toSet(): Set<Document>

Reads the entirety of this response into a Set.