createJavaClient

fun createJavaClient(settings: MongoClientSettings): MongoClient

Creates a Java sync driver client (com.mongodb.client.MongoClient) with the given settings (the codec registry is updated with KMongo mapping).

Use it for the Java driver features that the official Kotlin driver does not provide (GridFS...), and createClient (with the Java client) to get the Kotlin client sharing the same connection pool:

val javaClient = KMongo.createJavaClient(settings)
val client = KMongo.createClient(javaClient)
val bucket = GridFSBuckets.create(javaClient.getDatabase("db"))

fun createJavaClient(connectionString: String): MongoClient

Creates a Java sync driver client (com.mongodb.client.MongoClient) with the given connection string (see createJavaClient).