1MONGOC_TOPOLOGY_DESCRIPTION_HMAOSN_GROECA_DlTAiOBbPLmOEoL_nOSgGEoYRc_VDEERS(C3R)IPTION_HAS_READABLE_SERVER(3)
2
3
4
6 mongoc_topology_description_has_readable_server - mongoc_topology_de‐
7 scription_has_readable_server()
8
10 bool
11 mongoc_topology_description_has_readable_server (
12 mongoc_topology_description_t *td, const mongoc_read_prefs_t *prefs);
13
14 Determines if the topology has a readable server available. Servers
15 are filtered by the given read preferences only if the driver is con‐
16 nected to a replica set, otherwise the read preferences are ignored.
17 This function uses the driver's current knowledge of the state of the
18 MongoDB server or servers it is connected to; it does no I/O and it
19 does not block.
20
21 Use this function in a topology-changed callback registered with mon‐
22 goc_apm_set_topology_changed_cb. For historical reasons, the mon‐
23 goc_topology_description_t passed to the callback is a const pointer,
24 you must cast away const to pass the pointer to mongoc_topology_de‐
25 scription_has_readable_server.
26
28 • td: A mongoc_topology_description_t.
29
30 • read_prefs: A mongoc_read_prefs_t or NULL for default read prefer‐
31 ences.
32
34 True if there is a known server matching prefs.
35
37 Introduction to Application Performance Monitoring
38
40 MongoDB, Inc
41
43 2017-present, MongoDB, Inc
44
45
46
47
481.17.6 MONGOJCu_nTO0P3O,LO2G0Y2_1DESCRIPTION_HAS_READABLE_SERVER(3)