BSON_APPEND_BOOL(3)
π BSON_APPEND_BOOL(3) π
okay bestie, so this is a page from libbson β it's the BSON_APPEND_BOOL(3) situation and honestly it's a short one, so we're gonna get through it together, no stress π«Ά
β¨ SYNOPSIS β¨
you got two flavors, the macro and the real one:
#define BSON_APPEND_BOOL(b, key, val) \
bson_append_bool (b, key, (int) strlen (key), val)
bool
bson_append_bool (bson_t *bson, const char *key, int key_length, bool value);
the macro is giving "convenience era" β it literally just fills in the length for you with strlen. iconic π
πΈ PARAMETERS πΈ
bsonβ abson_t. it's the doc you're stuffing stuff into, the main character of the whole operation πkeyβ the name of the field. what you're calling it, bestie β¨key_lengthβ the length ofkey, or-1if you want it to just usestrlen(). lowkey the lazy-but-valid route, we respect it πvalueβtrueorfalse. that's it. that's the whole vibe check β it's a bool, there's only two options π
π¦ DESCRIPTION π¦
so bson_append_bool() shall append a new element to bson containing the boolean you handed it. yes, "shall" β very official of it. it's just adding a lil true-or-false to your document and calling it a day. no cap, that's the whole thing π
β RETURNS β
it returns true if the operation was applied successfully π
but heads up β it will fail if appending the value grows bson larger than INT32_MAX. that's the line, bestie, don't cross it. big numbers are not it here ππ₯
π AUTHOR π
MongoDB, Inc β the ones who brought you this whole libbson moment π
π§ COPYRIGHT π§
2009-present, MongoDB, Inc. β yeah, they've been at it a minute. legends, honestly π«‘
and that's the page, bestie!! short and sweet. anyway this was BSON_APPEND_BOOL(3), version 2.5.6, dated Oct 09, 2026 β write it down, remember it, slay π
β¨π
π¦ 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