asKtMongo¶
fun MongoClient.asKtMongo(): SyncMongoClient
Instantiates a KtMongo SyncMongoClient using an existing client from the official Kotlin driver.
This method allows taking advantage of the full configuration power of the official client.
Example¶
fun <Document : Any> MongoCollection<Document>.asKtMongo(
factory: BsonFactory = BsonFactory(this.codecRegistry),
propertyNameStrategy: PropertyNameStrategy = PropertyNameStrategy.Default,
objectIdGenerator: ObjectIdGenerator = ObjectIdGenerator.Jvm(),
type: KType
): SyncMongoCollection<Document>
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.
Example¶
fun MongoDatabase.asKtMongo(): SyncMongoDatabase
Instantiates a KtMongo SyncMongoDatabase using an existing client from the official Kotlin driver.
Example¶
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.