BSON_APPEND_BINARY(3)
π BSON_APPEND_BINARY π
okay so welcome to the libbson manual page for bson_append_binary(), bestie β¨ this is the one that appends binary data into a BSON document, and itβs honestly kind of a big deal. letβs get into it fr fr.
β¨ SYNOPSIS β¨
#define BSON_APPEND_BINARY(b, key, subtype, val, len) \
bson_append_binary (b, key, (int) strlen (key), subtype, val, len)
bool
bson_append_binary (bson_t *bson,
const char *key,
int key_length,
bson_subtype_t subtype,
const uint8_t *binary,
uint32_t length);
π PARAMETERS π
bsonβ abson_t. thatβs the document youβre adding to, periodt πkeyβ the key name. name it cute, name it clear π«Άkey_lengthβ the length ofkeyin bytes, or-1to usestrlen(). yes,-1is the βjust figure it outβ option β¨subtypeβ abson_subtype_tindicating the binary subtype.binaryβ a buffer to embed as binary data. May beNULLfor an empty binary value πlengthβ the length of buffer in bytes. Must be0ifbinaryisNULL. no cap, that condition matters.
πΈ DESCRIPTION πΈ
The bson_append_binary() function shall append a new element to bson containing the binary data provided. thatβs the whole vibe: you hand it binary data, it adds a new element to your bson, and it slays π
π¦ RETURNS π¦
Returns true if the operation was applied successfully. the function will fail if appending binary grows bson larger than INT32_MAX β so yeah, thereβs a size limit, bestie, and it is not a suggestion π
SEE ALSO: bson_append_binary_uninit()
π«Ά AUTHOR π«Ά
MongoDB, Inc
π COPYRIGHT π
2009-present, MongoDB, Inc.
catch you later β this was the BSON_APPEND_BINARY(3) page from libbson 2.5.6, dated Oct 09, 2026. go append some binary, bestie π
β¨
π¦ 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