MONGOC_URI_GET_READ_PREFS(3)

πŸ’… MONGOC_URI_GET_READ_PREFS πŸ’…

okay bestie, we're in the libmongoc docs and this one's a little throwback, so buckle up πŸŽ€


🚨 WARNING 🚨

Deprecated since version 1.2.0 β€” please, for the love of everything, use mongoc_uri_get_read_prefs_t() instead. this one's giving vintage, and not in the cute way 😭

✨ SYNOPSIS ✨

const bson_t *
mongoc_uri_get_read_prefs (const mongoc_uri_t *uri);

🧚 PARAMETERS 🧚

  • uri β€” a mongoc_uri_t. that's the whole list, she's low maintenance πŸ’–

🌸 DESCRIPTION 🌸

So the way this works: it fetches a bson document from a URI, and that document is holding all the read preference tag info. cute, right?

but bestie, heads up β€” this does not include the read preference mode. the mode is simply not invited to this party πŸ™ˆ

🫢 RETURNS 🫢

If uri has read preferences, you get back a bson document β€” and do not modify it, do not free it, it's not yours, hands off βœ‹ (borrowed, not gifted).

Otherwise? NULL. that's it, that's the vibe πŸ’€


πŸ‘‘ AUTHOR πŸ‘‘

MongoDB, Inc β€” the icons themselves 🫑


2009-present, MongoDB, Inc. β€” periodt πŸ’…


and that's the whole page, bestie! this was libmongoc version 1.30.13, dated Oct 09, 2026, signing off πŸ¦‹βœ¨ mwah πŸ’–

πŸ“¦ where this page comes from