MONGOC_URI_GET_OPTION_AS_BOOL(3)

✨ MONGOC_URI_GET_OPTION_AS_BOOL ✨

okay bestie so this one lives in libmongoc and it's honestly such a vibe β€” it's the little function that peeks at your URI and tells you "yeah that option's a true" or "nope, not today." πŸŽ€ let's get into it.


🌸 SYNOPSIS 🌸

like, here's the whole thing, literally copied with love:

bool
mongoc_uri_get_option_as_bool (const mongoc_uri_t *uri,
                               const char *option,
                               bool fallback);

it hands you back a bool, periodt. πŸ’…


πŸ¦‹ PARAMETERS πŸ¦‹

  • uri β€” a mongoc_uri_t. that's the URI you're snooping on, bestie πŸ‘€
  • option β€” the name of an option. and no cap: it's case insensitive, so don't stress about caps 🌈
  • fallback β€” a default value to return. your safety net when things don't work out 🫢

πŸ’– DESCRIPTION πŸ’–

so the way this works: it returns the value of the URI option if it's set and of the correct type (bool). if it's not set, or if it's set to an invalid type, you get fallback back instead β€” no drama, no crash, just your fallback sitting there being iconic. ✨

lowkey the best part: invalid type β‰  error, it just quietly gives you the fallback. very chill of it, honestly. 🧚

πŸ‘‘ AUTHOR πŸ‘‘

MongoDB, Inc β€” yes, the whole company, main character energy fr fr. πŸ’œ


2009-present, MongoDB, Inc. 🌸


and that's the whole page, bestie β€” go forth and get those bools πŸ”₯

mwah πŸ’‹ this was libmongoc version 2.5.6, dated Oct 09, 2026 β€” catch you on the next man page πŸ¦‹

πŸ“¦ where this page comes from