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β abson_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 π«Ά
π COPYRIGHT π
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
- epel 10: libbson-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