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