withReadPreference

fun withReadPreference(newReadPreference: ReadPreference): MongoDatabase

Create a new MongoDatabase instance with a different read preference.

Return

a new MongoDatabase instance with the different readPreference

Parameters

newReadPreference

the new ReadPreference for the database