Table of Contents

Class ReadConcern

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

Represents a read concern.

public sealed class ReadConcern : IEquatable<ReadConcern>, IConvertibleToBsonDocument
Inheritance
ReadConcern
Implements
Inherited Members

Constructors

ReadConcern(Optional<ReadConcernLevel?>)

Initializes a new instance of the ReadConcern class.

public ReadConcern(Optional<ReadConcernLevel?> level = default)

Parameters

level Optional<ReadConcernLevel?>

The level.

Properties

Available

Gets an available read concern.

public static ReadConcern Available { get; }

Property Value

ReadConcern

Default

Gets a default read concern.

public static ReadConcern Default { get; }

Property Value

ReadConcern

IsServerDefault

Gets a value indicating whether this is the server's default read concern.

public bool IsServerDefault { get; }

Property Value

bool

true if this instance is default; otherwise, false.

Level

Gets the level.

public ReadConcernLevel? Level { get; }

Property Value

ReadConcernLevel?

Linearizable

Gets a linearizable read concern.

public static ReadConcern Linearizable { get; }

Property Value

ReadConcern

Local

Gets a local read concern.

public static ReadConcern Local { get; }

Property Value

ReadConcern

Majority

Gets a majority read concern.

public static ReadConcern Majority { get; }

Property Value

ReadConcern

Snapshot

Gets a snapshot read concern.

public static ReadConcern Snapshot { get; }

Property Value

ReadConcern

Methods

Equals(ReadConcern)

public bool Equals(ReadConcern other)

Parameters

other ReadConcern

Returns

bool

Equals(object)

public override bool Equals(object obj)

Parameters

obj object

Returns

bool

FromBsonDocument(BsonDocument)

Creates a read concern from a document.

public static ReadConcern FromBsonDocument(BsonDocument document)

Parameters

document BsonDocument

The document.

Returns

ReadConcern

A read concern.

GetHashCode()

public override int GetHashCode()

Returns

int

ToBsonDocument()

Converts this read concern to a BsonDocument suitable to be sent to the server.

public BsonDocument ToBsonDocument()

Returns

BsonDocument

A BsonDocument.

ToString()

Returns a string that represents this instance.

public override string ToString()

Returns

string

A string that represents this instance.

With(Optional<ReadConcernLevel?>)

Returns a new instance of ReadConcern with some values changed.

public ReadConcern With(Optional<ReadConcernLevel?> level = default)

Parameters

level Optional<ReadConcernLevel?>

The level.

Returns

ReadConcern

A ReadConcern.