BSON_ITER_BOOL(3)

πŸ’– BSON_ITER_BOOL(3) β€” the libbson glow-up πŸ’–

okay so bestie, welcome to the <pink>BSON_ITER_BOOL</pink> page of the libbson manual (libbson, section 3, if you're keeping track πŸŽ€). this is the one that gets you a bool out of your iterator, and honestly? it's giving tiny-but-mighty. let's get into it ✨


🌸 SYNOPSIS 🌸

here's the whole vibe, literally verbatim:

#define BSON_ITER_HOLDS_BOOL(iter) (bson_iter_type ((iter)) == BSON_TYPE_BOOL)

bool
bson_iter_bool (const bson_iter_t *iter);

so you've got a macro for the vibe check (BSON_ITER_HOLDS_BOOL) and then the actual function, bson_iter_bool, which takes a const bson_iter_t * and hands you back a bool. slay. 🫢


πŸ¦‹ PARAMETERS πŸ¦‹

  • iter β€” a bson_iter_t. that's it. that's the whole list. simple, iconic, no notes πŸ’…

✨ DESCRIPTION ✨

so the bson_iter_bool() function shall return the boolean value of a BSON_TYPE_BOOL element. periodt. πŸŽ€

⚠️ but listen β€” it is a programming error to call this function on an element that is not a BSON_TYPE_BOOL. like, not "oopsie" error, we mean you wrote a bug error. do not do it. πŸ™ˆ

you can check that it's actually safe to call with bson_iter_type() or, even cuter, BSON_ITER_HOLDS_BOOL(). vibe check first, bool second. iykyk πŸ’€


πŸ”₯ RETURNS πŸ”₯

either true or false. that's the whole returns section. binary queen behavior, honestly πŸ‘‘βœ¨


πŸ’œ AUTHOR πŸ’œ

MongoDB, Inc 🫢


2009-present, MongoDB, Inc. β€” protecting the brand since forever, no cap πŸ’–


and that's the whole page, bestie! 🌸 this was libbson 2.5.6, dated Oct 09, 2026 β€” catch you on the next man page, mwah πŸ§šπŸ’…πŸ“

πŸ“¦ where this page comes from