Closed NoakPalander closed 2 years ago
With KMongo, you can use a raw connection string or the ConnectionString
class - both methods are supported https://litote.org/kmongo/dokka/kmongo/org.litote.kmongo/-k-mongo/index.html
Look at the mongo doc for raw connection string https://www.mongodb.com/docs/manual/reference/connection-string/
Or the mongo java driver doc for the ConnectionString
class https://www.mongodb.com/docs/drivers/java/sync/current/fundamentals/connection/mongoclientsettings/#socket-settings
HTH
It would appear that I was using the wrong property, this currently works
val settings = MongoClientSettings.builder()
.applyToClusterSettings {
it.serverSelectionTimeout(10, TimeUnit.SECONDS)
}
.build()
val client = KMongo.createClient(settings).coroutine
How do you specify a max time a connection can be waiting for, this is essentially a one liner with the pymongo driver (serverSelectionTimeoutMS) but seems to be outright impossible with kmongo, and there isnt anything mentioning how to properly set the setting in the documentation.