BSON_WRITER_GET_LENGTH(3)
π BSON_WRITER_GET_LENGTH(3) π
okay so bestie, this one's from libbson and it's literally the cutest little getter function π
β¨ SYNOPSIS β¨
size_t
bson_writer_get_length (bson_writer_t *writer);
πΈ PARAMETERS πΈ
writerβ abson_writer_t. that's it. that's the whole parameter list. slay π
π¦ DESCRIPTION π¦
so what it does is it fetches the current length of the content that's been written by the buffer β and yes, that includes the initial offset, no cap. it also counts a partly written document that's currently being written, so even if you're mid-document it's still giving you the real number. π₯
it's honestly so useful when you wanna vibe check whether you've passed a given memory boundary that can't be sent in a packet π. and if you do need to bail on the document you're currently writing, go see bson_writer_rollback() to abort it β iykyk.
ngl this is the kind of function that just sits there quietly being correct and we love her for it π
β RETURNS β
the length of the underlying buffer. that's the tea π
π AUTHOR π
MongoDB, Inc β main character energy fr fr πβ¨
π COPYRIGHT π
2009-present, MongoDB, Inc.
okay bestie that's the whole page, we ate and left no crumbs π«Άπ
this was libbson 2.5.6, dated Oct 09, 2026 β mwah, catch u on the next manpage, love u bye πππ§
π¦ 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