Skip to content

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

JvmMongoIterable

Implementation of MongoIterable based on MongoDB's MongoIterable.

To access the inner iterable, see asKotlinMongoIterable.

To convert an existing MongoDB iterable into an instance of this class, see asKtMongo.

Functions

asKotlinMongoIterable

@LowLevelApi
fun asKotlinMongoIterable(): MongoIterable<Document>

Converts a KtMongo MongoIterable into a MongoDB MongoIterable.

asSequence

asStream

Streams the results of this query into a Java Stream.

first

open override fun first(): Document

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

firstOrNull

open override fun firstOrNull(): Document?

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

forEach

open override fun forEach(action: (Document) -> Unit)

Executes action for each document returned by this query.

toList

open override fun toList(): List<Document>

Reads the entirety of this response into a List.

toSequence

toSet

open fun toSet(): Set<Document>

Reads the entirety of this response into a Set.

toString

open override fun toString(): String