Skip to content

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

Package-level declarations

Declaration and implementation of collections and iterables.

Types

JvmMongoCollection

Implementation of MongoCollection based on MongoDB's MongoCollection.

JvmMongoIterable

Implementation of MongoIterable based on MongoDB's MongoIterable.

LazyMongoIterable

MongoAggregationPipeline

class MongoAggregationPipeline<Output : Any> :  ERROR CLASS: Symbol not found for AbstractPipeline,  ERROR CLASS: Symbol not found for AggregationPipeline, 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

asKtMongo

Converts a MongoDB MongoIterable into a KtMongo MongoIterable.

@JvmOverloads
fun <Document : Any> MongoCollection<Document>.asKtMongo(nameStrategy: PropertyNameStrategy = PropertyNameStrategy.Default): JvmMongoCollection<Document>

Converts a MongoDB collection into a KtMongo collection.

filter

fun <Document : Any> MongoCollection<Document>.filter(filter: ERROR CLASS: Symbol not found for FilterQuery.() -> Unit): MongoCollection<Document>

Returns a filtered collection that only contains the elements that match filter.

first

firstOrNull

forEach

inline fun <Document : Any> LazyMongoIterable<Document>.forEach(noinline action: (Document) -> Unit)

toList

toSet