Table of Contents

Class ReadPreference

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.Core.dll

Represents a read preference.

public sealed class ReadPreference : IEquatable<ReadPreference>
Inheritance
ReadPreference
Implements
Inherited Members

Constructors

ReadPreference(ReadPreferenceMode, IEnumerable<TagSet>, TimeSpan?, ReadPreferenceHedge)

Initializes a new instance of the ReadPreference class.

Properties

Hedge

Gets the hedge.

MaxStaleness

Gets the maximum staleness.

Nearest

Gets an instance of ReadPreference that represents a Nearest read preference.

Primary

Gets an instance of ReadPreference that represents a Primary read preference.

PrimaryPreferred

Gets an instance of ReadPreference that represents a PrimaryPreferred read preference.

ReadPreferenceMode

Gets the read preference mode.

Secondary

Gets an instance of ReadPreference that represents a Secondary read preference.

SecondaryPreferred

Gets an instance of ReadPreference that represents a SecondaryPreferred read preference.

TagSets

Gets the tag sets.

Methods

Equals(ReadPreference)
Equals(object)
FromBsonDocument(BsonDocument)

Creates a new ReadPreference instance from a BsonDocument.

GetHashCode()
ToString()
With(ReadPreferenceHedge)

Returns a new instance of ReadPreference with some values changed.

With(ReadPreferenceMode)

Returns a new instance of ReadPreference with some values changed.

With(IEnumerable<TagSet>)

Returns a new instance of ReadPreference with some values changed.

With(TimeSpan?)

Returns a new instance of ReadPreference with some values changed.