mongoc_client_select_server3
Parameters
- •
-
client: A mongoc_client_t.
- •
-
for_writes: Whether to choose a server suitable for writes or reads.
- •
-
prefs: An optional mongoc_read_prefs_t. Iffor_writesis true,prefsmust be NULL. Otherwise, useprefsto customize server selection, or pass NULL to use read preference PRIMARY.
- •
-
error: An optional location for a bson_error_t or NULL.
Returns
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.
History
- Debian 13 (Trixie): the text shown here
- Debian 12 (Bookworm)
- Debian 11 (Bullseye)
- Debian 10 (Buster)
- Debian 9 (Stretch)