Skip to content

opensavvy.ktmongo.sync

Types

SyncMongoAggregateIterable

interface SyncMongoAggregateIterable<Document : Any> : MongoIterable<Document> 

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

SyncMongoAggregationPipeline

interface SyncMongoAggregationPipeline<Document : Any> : MongoAggregationPipeline<Document> 

An aggregation pipeline built on top of the official Kotlin driver.

SyncMongoClient

interface SyncMongoClient : MongoClient

Entry-point to the KtMongo Coroutines driver.

SyncMongoCollection

interface SyncMongoCollection<Document : Any> : MongoCollection<Document> 

A collection stores related documents together.

SyncMongoDatabase

interface SyncMongoDatabase : MongoDatabase

A grouping of collections with the same theme.

SyncMongoFindIterable

interface SyncMongoFindIterable<Document : Any> : MongoIterable<Document> 

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

Functions

asKtMongo

Instantiates a KtMongo SyncMongoAggregateIterable using an existing flow from the official Kotlin driver.

Instantiates a KtMongo SyncMongoFindIterable using an existing flow from the official Kotlin driver.

fun MongoClient.asKtMongo(): SyncMongoClient

Instantiates a KtMongo SyncMongoClient using an existing client from the official Kotlin driver.

fun MongoDatabase.asKtMongo(): SyncMongoDatabase

Instantiates a KtMongo SyncMongoDatabase using an existing client from the official Kotlin driver.

inline fun <Document : Any> MongoCollection<Document>.asKtMongo(
    factory: BsonFactory = BsonFactory(this.codecRegistry), 
    propertyNameStrategy: PropertyNameStrategy = PropertyNameStrategy.Default, 
    objectIdGenerator: ObjectIdGenerator = ObjectIdGenerator.Jvm()
): SyncMongoCollection<Document>

Instantiates a KtMongo SyncMongoCollection using an existing collection from the official Kotlin driver.

fun <Document : Any> MongoCollection<Document>.asKtMongo(
    factory: BsonFactory = BsonFactory(this.codecRegistry), 
    propertyNameStrategy: PropertyNameStrategy = PropertyNameStrategy.Default, 
    objectIdGenerator: ObjectIdGenerator = ObjectIdGenerator.Jvm(), 
    type: KType
): SyncMongoCollection<Document>

Instantiates a KtMongo SyncMongoCollection using an existing collection from the official Kotlin driver.