mongoc_client_select_server
mongoc_client_select_server()
- Provided by: libmongoc-doc (Version: 1.21.0-1build1)
- Source: mongo-c-driver
- Report a bug
mongoc_client_select_server()
mongoc_server_description_t *
mongoc_client_select_server (mongoc_client_t *client,
bool for_writes,
const mongoc_read_prefs_t *prefs,
bson_error_t *error) BSON_GNUC_WARN_UNUSED_RESULT;
Choose a server for an operation, according to the logic described in the Server Selection Spec.
Use this function only for building a language driver that wraps the C Driver. When writing applications in C, higher-level functions automatically select a suitable server.
A mongoc_server_description_t that must be freed with mongoc_server_description_destroy. If no suitable server is found, returns NULL and error is filled out.
MongoDB, Inc
2017-present, MongoDB, Inc