Table of Contents

Method WithReadPreference

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.Legacy.dll

WithReadPreference(ReadPreference)

Returns a new MongoCollection instance with a different read preference setting.

public virtual MongoCollection<TDefaultDocument> WithReadPreference(ReadPreference readPreference)

Parameters

readPreference ReadPreference

The read preference.

Returns

MongoCollection<TDefaultDocument>

A new MongoCollection instance with a different read preference setting.