#include <mongocxx/v_noabi/mongocxx/events/topology_description.hpp>
A description of the topology of one or more connected MongoDB servers.
- See also
-
◆ topology_description()
◆ has_readable_server()
Determines if the topology has a readable server available. Servers are filtered by the given read preferences only if the driver is connected to a replica set, otherwise the read preferences are ignored. This function uses the driver's current knowledge of the state of the MongoDB server or servers it is connected to; it does no I/O.
- Returns
- Whether there is a readable server available.
◆ has_writable_server()
Determines if the topology has a writable server available, such as a primary, mongos, or standalone. This function uses the driver's current knowledge of the state of the MongoDB server or servers it is connected to; it does no I/O.
- Returns
- Whether there is a writable server available.
◆ operator v1::events::topology_description()
◆ servers()
Fetches descriptions for all known servers in the topology.
- Returns
- An array of server_description objects.
◆ type()
The topology type: "Unknown", "Sharded", "ReplicaSetNoPrimary", "ReplicaSetWithPrimary", or "Single".
- Returns
- The type as a short-lived string view.
The documentation for this class was generated from the following file: