SyncMongoClient
fun SyncMongoClient(connectionString: String = "mongodb://localhost:27017"): SyncMongoClient(source)
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 main() = runBlocking {
val client = SyncMongoClient()
val database = client.database("my-app")
val users = database.collection<UserDto>("users")
println("Users: ${users.count()}")
}Content copied to clipboard