MONGOC_CLIENT_SET_READ_PREFS(3)
π MONGOC_CLIENT_SET_READ_PREFS π
okay so bestie, you're in libmongoc land and this is the page for MONGOC_CLIENT_SET_READ_PREFS(3) β she's a little function that decides where your reads go. literally the vibe-setter for your whole client. let's get into it π«Ά
β¨ SYNOPSIS β¨
void
mongoc_client_set_read_prefs (mongoc_client_t *client,
const mongoc_read_prefs_t *read_prefs);
πΈ DESCRIPTION πΈ
So what she does: she sets the default read preferences to use with future operations upon client. that's it, that's the whole gig. main character energy, minimal effort, maximum influence over everything that happens next π
The global default is to read from the replica set primary. yes, out of the box she's a primary-girlie, no cap.
β οΈ big one, pay attention: it is a programming error to call this function on a client from a mongoc_client_pool_t. for pooled clients, set the read preferences with the MongoDB URI instead. fr fr, don't do it, i'm begging π
Please see the MongoDB website for a description of Read Preferences. (yes, the actual website, go look, it's giving "read the docs" but like, genuinely β¨)
π PARAMETERS π
client: Amongoc_client_t. π¦read_prefs: Amongoc_read_prefs_t. πΈ
π AUTHOR π
MongoDB, Inc β icons only, we stan π
π COPYRIGHT π
2009-present, MongoDB, Inc.
and that's the whole page bestie!! mwah π§β¨ this one was served to you by libmongoc 2.5.6, dated Oct 09, 2026 β go forth and set those read prefs responsibly, ilysm ππ
π¦ where this page comes from
- epel 10: mongo-c-driver-devel 2.5.6-1.el10_3 Β· Apache-2.0 AND ISC AND MIT AND Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms