Since: 1.13.0

class TopologyDescription (View source)

Constants

TYPE_UNKNOWN

TYPE_SINGLE

TYPE_SHARDED

TYPE_REPLICA_SET_NO_PRIMARY

TYPE_REPLICA_SET_WITH_PRIMARY

TYPE_LOAD_BALANCED

Methods

array
getServers()

Returns the servers in the topology

string
getType()

Returns a string denoting the type of this topology

bool
hasReadableServer(ReadPreference|null $readPreference = null)

Returns whether the topology has a readable server

bool
hasWritableServer()

Returns whether the topology has a writable server

void
__wakeup()

No description

Details

final array getServers()

Returns the servers in the topology

Return Value

array

Returns an array of MongoDB\Driver\ServerDescription objects corresponding to the known servers in the topology.

final string getType()

Returns a string denoting the type of this topology

Return Value

string

final bool hasReadableServer(ReadPreference|null $readPreference = null)

Returns whether the topology has a readable server

Parameters

ReadPreference|null $readPreference

Return Value

bool

final bool hasWritableServer()

Returns whether the topology has a writable server

Return Value

bool

final void __wakeup()

No description

Return Value

void