BSON_NEW(3)

✨ BSON_NEW ✨

okay so real quick β€” this page lives in libbson, section 3 of the manual, and it's literally the shortest lil glow-up you'll ever read. bestie, it's about one function. one. and it ate. πŸ’…


🌸 SYNOPSIS 🌸

bson_t *
bson_new (void);

no args, no drama, no options to remember. she just exists. 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

so the bson_new() function shall create a new bson_t structure on the heap. like, on the heap. malloc vibes. it's giving main character energy, but it's also giving responsibility β€” you gotta free it with bson_destroy() when it is no longer in use. don't just ghost your bson_t, bestie, that's a memory leak and the vibe check will NOT pass. 😭

ngl, this is the part everyone forgets: bson_new() gives you a shiny new heap-allocated bson_t, and bson_destroy() is the one who cleans up after the party. they're a package deal. iykyk. πŸŽ€

⭐ RETURNS ⭐

a newly allocated bson_t that should be freed with bson_destroy(). yup. that's the whole return section. she's simple, she's iconic, she's literally a pointer. ✨πŸ”₯


πŸ‘‘ AUTHOR πŸ‘‘

MongoDB, Inc β€” the icons behind it all. slay. πŸ’œ


2009-present, MongoDB, Inc. β€” yeah, they've been at this a minute. periodt. πŸ’€


okay that's the whole page, hope you enjoyed the shortest manpage tour ever 🧚

libbson 2.5.6 πŸ¦‹ β€” dated Oct 09, 2026, and that's the whole footer, mwah. πŸ’– no cap, go call bson_destroy(). πŸ’…
πŸ“¦ where this page comes from