DOKK / manpages / debian 10 / libmongoc-doc / mongoc_topology_description_has_writable_server.3.en
MONGOC_TOPOLOGY_DESCRIPTION_HAS_WRITABLE_SERVER(3) MongoDB C Driver MONGOC_TOPOLOGY_DESCRIPTION_HAS_WRITABLE_SERVER(3)

mongoc_topology_description_has_writable_server - mongoc_topology_description_has_writable_server()

bool
mongoc_topology_description_has_writable_server (

mongoc_topology_description_t *td);


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 and it does not block.

Use this function in a topology-changed callback registered with mongoc_apm_set_topology_changed_cb. For historical reasons, the mongoc_topology_description_t passed to the callback is a const pointer, you must cast away const to pass the pointer to mongoc_topology_description_has_writable_server.

td: A mongoc_topology_description_t.

True if there is a known writable server.

Introduction to Application Performance Monitoring

MongoDB, Inc

2017-present, MongoDB, Inc

February 23, 2019 1.14.0