BSON_APPEND_INT64(3)
π BSON_APPEND_INT64(3) π
okay bestie, so this is the libbson page for BSON_APPEND_INT64 β yes that's a 3 in the parens, that's a C library thing, iykyk β¨
πΈ SYNOPSIS πΈ
#define BSON_APPEND_INT64(b, key, val) \
bson_append_int64 (b, key, (int) strlen (key), val)
bool
bson_append_int64 (bson_t *bson,
const char *key,
int key_length,
int64_t value);
so there's the macro version (convenience, slay π
) and the real function underneath β literally the same thing, the macro just fills in the strlen (key) for you like the little helper it is π«Ά
π PARAMETERS π
bsonβ abson_t. that's your doc, your canvas, your main character πkeyβ an ASCII C string holding the name of the field. give it a cute name, it deserves it β¨key_lengthβ the length ofkeyin bytes, fr fr. or pass-1and let it figure the length out withstrlen()πvalueβ anint64_t. a whole 64 bits of signed integer energy π
π¦ DESCRIPTION π¦
The bson_append_int64() function shall append a new element to bson containing a 64-bit signed integer. that's it. that's the whole vibe. big number goes in, doc gets one element richer, you move on with your life π
π RETURNS π
Returns true if the operation was applied successfully. like, genuinely successful, no cap π«Ά
β οΈ okay important: the function will fail if appendingvaluegrowsbsonlarger thanINT32_MAX. so if your doc is already kinda thicc and this append pushes it over? nope. not happening. check your return value bestie, don't just assume π
π AUTHOR π
MongoDB, Inc
π COPYRIGHT π
2009-present, MongoDB, Inc.
and that's the page, periodt π β this was libbson version 2.5.6, dated Oct 09, 2026. go append some integers, you got this π§
π¦ 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