BSON_COPY(3)

✨ SYNOPSIS ✨

okay so bestie, welcome to the BSON_COPY(3) page from libbson β€” it's giving tiny-but-mighty icon behavior, and we're literally about to get into it πŸ’…

bson_t *
bson_copy (const bson_t *bson);

πŸŽ€ PARAMETERS πŸŽ€

  • bson β€” a bson_t. that's the whole assignment, bestie, no cap 🫢

🌸 DESCRIPTION 🌸

The bson_copy() function shall copy the contents of a bson document into a new bson_t. it's a whole duplicate-your-doc moment, and honestly? slay ✨

The resulting bson_t should be freed with bson_destroy(). yes bestie, that means cleanup is mandatory β€” don't just leave it vibing in memory forever 😭

πŸ”₯ RETURNS πŸ”₯

A newly allocated bson_t that should be freed with bson_destroy(). it's fresh, it's new, it's yours β€” and it's lowkey expecting you to take responsibility for it πŸ’–

πŸ‘‘ AUTHOR πŸ‘‘

MongoDB, Inc

2009-present, MongoDB, Inc.


mwah πŸ’‹ this iconic little page is serving source/version libbson 2.5.6, dated Oct 09, 2026 β€” periodt, see you in the group chat 🫢🌈

πŸ“¦ where this page comes from