MongoDB driver for Kotlin (synchronous) • opensavvy.ktmongo.sync • JvmMongoIterable
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>
asStream
¶
Streams the results of this query into a Java Stream
.
first
¶
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
¶
Executes action
for each document returned by this query.
toList
¶
Reads the entirety of this response into a List
.
toSequence
¶
open fun toSequence(): Sequence<Document>
toSet
¶
Reads the entirety of this response into a Set
.