MongoDB driver for Kotlin (synchronous) • opensavvy.ktmongo.sync
Package-level declarations¶
Declaration and implementation of collections and iterables.
Types¶
JvmMongoCollection¶
class JvmMongoCollection<Document : Any> : MongoCollection<Document>
Implementation of MongoCollection based on MongoDB's MongoCollection.
JvmMongoIterable¶
class JvmMongoIterable<Document : Any> : MongoIterable<Document>
Implementation of MongoIterable based on MongoDB's MongoIterable.
LazyMongoIterable¶
interface LazyMongoIterable<Document : Any>
MongoAggregationPipeline¶
class MongoAggregationPipeline<Output : Any> : LazyMongoIterable<Output>
MongoCollection¶
Methods to interact with a MongoDB collection.
MongoIterable¶
interface MongoIterable<Document : Any>
Streaming-ready iterable client to read data from the database.
Functions¶
asIterable¶
inline fun <Document : Any> LazyMongoIterable<Document>.asIterable(): MongoIterable<Document>
asKtMongo¶
Converts a MongoDB collection into a KtMongo collection.
Converts a MongoDB MongoIterable into a KtMongo MongoIterable.
filter¶
fun <Document : Any> MongoCollection<Document>.filter(filter: <Document>.() -> Unit): MongoCollection<Document>
Returns a filtered collection that only contains the elements that match filter.
first¶
firstOrNull¶
inline fun <Document : Any> LazyMongoIterable<Document>.firstOrNull(): Document?