with Read Preference
abstract fun withReadPreference(readPreference: ReadPreference): MongoDatabase
Content copied to clipboard
Create a new MongoDatabase instance with a different read preference.
Return
a new MongoDatabase instance with the different readPreference
Parameters
read Preference
the new com.mongodb.ReadPreference for the database