BSON_GET_DATA(3)
π bson_get_data β the libbson manual, bestie edition β¨
Okay so real talk, this is BSON_GET_DATA(3) from the libbson manual and it's literally the simplest little icon in the whole library. Let's get into it π«Ά
β¨ SYNOPSIS β¨
const uint8_t *
bson_get_data (const bson_t *bson);
That's it. That's the whole function signature. Look at her go π
π¦ PARAMETERS π¦
bsonβ abson_t. That's the whole param list, no cap. Just hand her a document and she's good π
πΈ DESCRIPTION πΈ
The bson_get_data() function shall return the raw buffer of a bson document. Like, the actual bytes. The unfiltered, unprocessed, straight-off-the-shelf bytes π₯
And the way that this is useful: you can pair it up with the len property of a bson_t if you want to copy the raw buffer around. So bson_get_data() tells you where the bytes start, len tells you how many there are, and together they're giving copy-the-whole-thing energy β¨ iykyk
π RETURNS π
A buffer which should not be modified or freed.
Fr fr bestie, do NOT touch it and do NOT free it π It's not yours, it's hers. Just look at it respectfully and move on. Modifying or freeing it is not the vibe, okay? π
π AUTHOR π
MongoDB, Inc β the main characters behind all of this π«Ά
π COPYRIGHT π
2009-present, MongoDB, Inc.
And that's the whole page, bestie β go forth and read those raw bytes responsibly π¦β¨ This has been libbson version 2.5.6, dated Oct 09, 2026, signing off with a lil π and a reminder that you ate that π
π¦ 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