MONGOC_COLLECT...SET_READ_PREFS(3)
okay bestie, welcome to the MONGOC_COLLECT...SET_READ_PREFS(3) page from the libmongoc manual 💅 this one is short and sweet — it’s giving “set the default read preferences for a collection” energy, and we are keeping every detail, no cap.
✨ SYNOPSIS ✨
Here’s the exact signature, straight from the group chat:
void
mongoc_collection_set_read_prefs (mongoc_collection_t *collection,
const mongoc_read_prefs_t *read_prefs);
💖 PARAMETERS 💖
collection— amongoc_collection_t. That’s the collection whose default read-prefs vibe we’re updating 💅read_prefs— amongoc_read_prefs_t. This is the read-preferences bundle you’re handing over 🫶
🌸 DESCRIPTION 🌸
This function sets the default read preferences to use for operations on collection that don’t specify a read preference. Lowkey iconic: the collection gets a default so the operation doesn’t have to bring its own.
The global default is MONGOC_READ_PRIMARY: if the client is connected to a replica set, it reads from the primary; otherwise, it reads from the current MongoDB server. That’s the whole read-preference situation, fr fr.
For the full Read Preferences lore, the page says please see the MongoDB website for a description of Read Preferences ✨
👑 AUTHOR 👑
MongoDB, Inc — author credit, periodt.
🎀 COPYRIGHT 🎀
2009-present, MongoDB, Inc. — copyright line, preserved exactly 🫶
source/version + date sign-off: this page is from libmongoc version 2.5.6, with footer date Oct 09, 202 (yes, that’s what the footer shows — the last bit runs into the title 💀). byeee bestie, go set those read prefs 💖✨
📦 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