CoroutineMongoClient

fun CoroutineMongoClient(connectionString: String = "mongodb://localhost:27017"): CoroutineMongoClient(source)

Instantiates a KtMongo CoroutineMongoClient 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 = CoroutineMongoClient()

val database = client.database("my-app")
val users = database.collection<UserDto>("users")

println("Users: ${users.count()}")
}