BSON_APPEND_DOCUMENT_END(3)

πŸ’… BSON_APPEND_DOCUMENT_END(3) πŸ’…

okay so bestie, welcome to BSON_APPEND_DOCUMENT_END(3) β€” it's a libbson page, section 3, and it's literally the "and that's a wrap" moment for building a BSON document by hand πŸŽ€


✨ SYNOPSIS ✨

bool
bson_append_document_end (bson_t *bson, bson_t *child);

Like, that's the whole vibe. Two args, one bool out. Slay.


🫢 PARAMETERS 🫢

  • bson β€” a bson_t. Just… a bson_t. The parent one. The main character πŸ‘‘
  • child β€” the child bson_t, and the important part is that you initialized it in a call to bson_append_document_begin(). No begin, no end, iykyk πŸ’€

🌸 DESCRIPTION 🌸

So here's the tea: bson_append_document_end() shall complete the appending of a document that you started with bson_append_document_begin(). Start it with begin, finish it with end. It's giving matched set. It's giving bookends πŸ¦‹

and like, real talk β€” child is invalid after you call this function. Not "kinda stale", not "maybe still fine", invalid. Don't touch it, don't read it, don't be weird about it πŸ™ˆ Consider it retired, off to live on a farm.

⭐ RETURNS ⭐

Returns true if successful. That's it, that's the return value. πŸŽ€


πŸ’œ AUTHOR πŸ’œ

MongoDB, Inc β€” the icons who brought you this whole situation.


2009-present, MongoDB, Inc.


okay bye bestie, go finish that document properly, mwah 🫢✨

this has been libbson 2.5.6, dated Oct 09, 2026, page BSON_APPEND_DOCUMENT_END(3) β€” periodt πŸ’…

πŸ“¦ where this page comes from