BSON_APPEND_DOCUMENT_BEGIN(3)
π BSON_APPEND_DOCUMENT_BEGIN(3) β the libbson glow-up π
okay bestie, welcome to the BSON_APPEND_DOCUMENT_BEGIN(3) page from libbson β this one is literally about starting a sub-document the right way, no cap β¨
πΈ SYNOPSIS πΈ
#define BSON_APPEND_DOCUMENT_BEGIN(b, key, child) \
bson_append_document_begin (b, key, (int) strlen (key), child)
bool
bson_append_document_begin (bson_t *bson,
const char *key,
int key_length,
bson_t *child);
π PARAMETERS π
bsonβ Abson_t. your main character document πkeyβ An ASCII C string containing the name of the field π¦key_lengthβ The length ofkeyin bytes, or-1to determine the length withstrlen()βchildβ An uninitializedbson_tto be initialized as the sub-document π«Ά
β¨ DESCRIPTION β¨
The bson_append_document_begin() function shall begin appending a sub-document to bson. Use child to add fields to the sub-document. When completed, call bson_append_document_end() to complete the element. periodt π
bestie, important:childMUST be an uninitializedbson_tto avoid leaking memory. not me warning you about a memory leak β this is serious, fr fr π
π₯ RETURNS π₯
Returns true if the operation was applied successfully. The function will fail if bson must grow larger than INT32_MAX. she has limits, okay π
π AUTHOR π
MongoDB, Inc
π COPYRIGHT π
2009-present, MongoDB, Inc.
xoxo, your libbson bestie π«Ά this iconic little page is from version 2.5.6, dated Oct 09, 2026, and yes β itβs giving BSON_APPEND_DOCUMENT_BEGIN(3) energy πβ¨
π¦ 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