BSON_ITER_DUP_UTF8(3)

πŸ’… BSON_ITER_DUP_UTF8(3) πŸ’…

okay so this is a libbson manual page, and we are literally about to make friends with bson_iter_dup_utf8(). stay with me bestie, it’s giving β€œtiny function, very useful” energy ✨

SYNOPSIS 🌸

char *
bson_iter_dup_utf8 (const bson_iter_t *iter, uint32_t *length);

PARAMETERS πŸŽ€

  • iter β€” a bson_iter_t. yep, that’s the iterator bestie.
  • length β€” an optional location for the length of the UTF-8 encoded string. optional, so no pressure, but it’s there if you need it πŸ’–

DESCRIPTION πŸ¦‹

so this function is similar to bson_iter_utf8() β€” like, same vibe β€” except that it calls bson_strndup() on the result. that’s the whole glow-up. no cap. πŸ’…

RETURNS ✨

it returns a newly allocated string that should be freed with bson_free(). yes bestie, newly allocated means you gotta free it. don’t leave it hanging 😭🫢

AUTHOR πŸ’œ

MongoDB, Inc

2009-present, MongoDB, Inc.


xoxo, your libbson bestie πŸ’– this was version 2.5.6, dated Oct 09, 2026 β€” slay and read the docs responsibly πŸ‘‘

πŸ“¦ where this page comes from