MongoIterable

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

External resources

Functions

Link copied to clipboard
abstract fun asFlow(): Flow<Document>

Streams the results into a Flow.

Link copied to clipboard

This method always throws an exception.

Link copied to clipboard
abstract suspend fun first(): Document

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

Link copied to clipboard
abstract suspend fun firstOrNull(): Document?

Returns the first document found by this query, or returns null.

Link copied to clipboard
abstract suspend fun forEach(action: suspend (Document) -> Unit)

Executes action for each document returned by this query.

Link copied to clipboard
open suspend fun toList(): List<Document>

Reads the entirety of this iterable into a List.

Link copied to clipboard

This method always throws an exception.

Link copied to clipboard
open suspend fun toSet(): Set<Document>

Reads the entirety of this iterable into a Set.