withReadPreference

fun withReadPreference(newReadPreference: ReadPreference): MongoCluster

Create a new MongoCluster instance with a different read preference.

Return

a new MongoCluster instance with the different readPreference

Parameters

newReadPreference

the new ReadPreference for the database