kmongo / org.litote.kmongo.coroutine / CoroutineDatabase / withReadPreference

withReadPreference

fun withReadPreference(readPreference: ReadPreference): CoroutineDatabase (source)

Create a new MongoDatabase instance with a different read preference.

Parameters

readPreference - the new com.mongodb.ReadPreference for the collection

Return
a new MongoDatabase instance with the different readPreference