fun withReadPreference(readPreference: ReadPreference): CoroutineDatabase
(source)
Create a new MongoDatabase instance with a different read preference.
readPreference
- the new com.mongodb.ReadPreference for the collection
Return
a new MongoDatabase instance with the different readPreference