Since: 1.1.0

final class ReadConcern implements Serializable, Serializable (View source)

MongoDB\Driver\ReadConcern controls the level of isolation for read operations for replica sets and replica set shards. This option requires the WiredTiger storage engine and MongoDB 3.2 or later.

Constants

LINEARIZABLE Since: 1.2.0

LOCAL

MAJORITY

AVAILABLE Since: 1.4.0

SNAPSHOT Since: 1.11.0

Methods

__construct(string|null $level = null)

Construct immutable ReadConcern

static 
__set_state(array $properties)

No description

string|null
getLevel()

Returns the ReadConcern's "level" option

PackedArray
bsonSerialize()

Returns an object for BSON serialization

bool
isDefault()

Checks if this is the default read concern

string|null
serialize()

Serialize a ReadConcern

void
unserialize(string $data)

Unserialize a ReadConcern

Details

final __construct(string|null $level = null)

Construct immutable ReadConcern

Parameters

string|null $level

static __set_state(array $properties)

No description

Parameters

array $properties

final string|null getLevel()

Since: 1.0.0

Returns the ReadConcern's "level" option

Return Value

string|null

final PackedArray bsonSerialize()

Since: 1.2.0

Returns an object for BSON serialization

Return Value

PackedArray

final bool isDefault()

Since: 1.3.0

Checks if this is the default read concern

Return Value

bool

Exceptions

InvalidArgumentException

final string|null serialize()

Since: 1.7.0

Serialize a ReadConcern

Return Value

string|null

The string representation of the object or null

Exceptions

InvalidArgumentException

final void unserialize(string $data)

Since: 1.7.0

Unserialize a ReadConcern

Parameters

string $data

The string representation of the object.

Return Value

void

Exceptions

InvalidArgumentException
UnexpectedValueException