kmongo / org.litote.kmongo.coroutine / CoroutineCollection / withReadPreference

withReadPreference

fun withReadPreference(readPreference: ReadPreference): CoroutineCollection<T> (source)

Create a new MongoCollection instance with a different read preference.

Parameters

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

Return
a new MongoCollection instance with the different readPreference