BSON_ITER_RECURSE(3)

πŸ’… BSON_ITER_RECURSE πŸ’…

okay so bestie, welcome to bson_iter_recurse(3) β€” that's the libbson manual page, and honestly? it's a little function that does a very big slay. let's get into it πŸŽ€


✨ SYNOPSIS ✨

bool
bson_iter_recurse (const bson_iter_t *iter, bson_iter_t *child);

🫢 PARAMETERS 🫢

  • iter β€” A bson_iter_t. yeah. that's the whole description. she's a bson_iter_t, she iterates, she's iconic πŸ’…
  • child β€” A bson_iter_t. also just a bson_iter_t. that's where the recurse lands, babes ✨

πŸ¦‹ DESCRIPTION πŸ¦‹

so bson_iter_recurse() shall initialize child using the embedded document or array that iter is currently observing. that's it. that's the vibe. you're standing on a document, and this function gives you your own little iterator to go wander around inside it 🌸

⚠️ but listen β€” if there was a failure to initialize the iter, false is returned, and both iter and child should be considered invalid. like, both of them. not just the baby one. don't go touching either of them after that, fr fr 😭

and this should only be called when you're observing an element of type BSON_TYPE_ARRAY or BSON_TYPE_DOCUMENT. no cap β€” those are the only two types where this makes any sense. anything else and you're just out here in the void πŸ’€


⭐ RETURNS ⭐

if iter observes an element of type BSON_TYPE_ARRAY or BSON_TYPE_DOCUMENT, then child is initialized and the function returns true. yay! πŸŽ‰ slay! the vibe check passed ✨

otherwise, the function returns false and child is invalid. so like... don't use it. she's not ready. she needs a minute πŸ™ˆ


πŸ‘‘ AUTHOR πŸ‘‘

MongoDB, Inc β€” the main characters themselves πŸ’œ


2009-present, MongoDB, Inc.


okay that's the whole page bestie, go forth and recurse responsibly πŸ§šπŸ’–

β€” with love from the libbson girlies, version 2.5.6, dated Oct 09, 2026 πŸ“β­

πŸ“¦ where this page comes from