Toggle table of contents sidebar
topology_description
– An object representation of a deployment of MongoDB servers.¶
Represent a deployment of MongoDB servers.
See also
This module is compatible with both the synchronous and asynchronous PyMongo APIs.
Representation of a deployment of MongoDB servers.
topology_type (int) – initial type
server_descriptions (dict[_Address, ServerDescription]) – dict of (address, ServerDescription) for all seeds
replica_set_name (Optional[str]) – replica set name or None
max_set_version (Optional[int]) – greatest setVersion seen from a primary, or None
max_election_id (Optional[ObjectId]) – greatest electionId seen from a primary, or None
topology_settings (Any) – a TopologySettings
List of servers matching the provided selector(s).
selector (Any) – a callable that takes a Selection as input and returns a Selection as output. For example, an instance of a read preference from read_preferences
.
address (Tuple[str, int | None] | None) – A server address to select.
custom_selector (Callable[[List[ServerDescription]], List[ServerDescription]] | None) – A callable that augments server selection rules. Accepts a list of ServerDescription
objects and return a list of server descriptions that should be considered suitable for the desired operation.
Added in version 3.4.
Raise ConfigurationError if any server is incompatible.
A server is incompatible if its wire protocol version range does not overlap with PyMongo’s.
None
Minimum of all servers’ max wire versions, or None.
Whether there are any Servers of types besides Unknown.
Does this topology have any readable servers available matching the given read preference?
read_preference (_ServerMode) – an instance of a read preference from read_preferences
. Defaults to PRIMARY
.
Note
When connected directly to a single server this method always returns True
.
Added in version 3.4.
Does this topology have a writable server available?
Note
When connected directly to a single server this method always returns True
.
Added in version 3.4.
List of Servers of types besides Unknown.
Minimum logical session timeout, or None.
Greatest electionId seen from a primary, or None.
Greatest setVersion seen from a primary, or None.
List of readable Servers.
The replica set name.
A copy of this description, with all servers marked Unknown.
A copy of this description, with one server marked Unknown.
dict of (address, ServerDescription
).
dict[Tuple[str, int | None], ServerDescription]
The type of this topology.
The topology type as a human readable string.
Added in version 3.4.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4