JvmMongoIterable¶
class JvmMongoIterable<Document : Any> : MongoIterable<Document>
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¶
open fun asSequence(): Sequence<Document>
Deprecated (with error)
Kotlin Sequences are not capable of closing a resource after they are done. Using sequences with a MongoIterable will create memory leaks. Instead, use toList, forEach, asStream (Java only) or the coroutines driver's asFlow
Replace with
asStream¶
first¶
Returns the first document found by this query, or throws an exception.
See also
Throws
NoSuchElementException-
If this query returned no results.
firstOrNull¶
open override fun firstOrNull(): Document?
forEach¶
toList¶
toSequence¶
open fun toSequence(): Sequence<Document>
Deprecated (with error)
Kotlin Sequences are not capable of closing a resource after they are done. Using sequences with a MongoIterable will create memory leaks. Instead, use toList, forEach, asStream (Java only) or the coroutines driver's asFlow
Replace with