BSON_ITER_FIND_W_LEN(3)

πŸ’… BSON_ITER_FIND_W_LEN πŸ’…

okay so bestie, this one lives in the libbson manual and it's literally the "find my key but make it length-aware" function πŸŽ€ she's giving precision, she's giving control, she's giving iykyk.


✨ SYNOPSIS ✨

bool
bson_iter_find_w_len (bson_iter_t *iter, const char *key, int keylen);

🌸 PARAMETERS 🌸

  • iter β€” a bson_iter_t. that's your iterator bestie, the little scroller doing the actual walking πŸšΆβ€β™€οΈ
  • key β€” a string containing the requested key. the thing you're hunting for πŸ”
  • keylen β€” an integer indicating the length of the key string. you're telling her exactly how long the key is, no guessing, no cap πŸ’…

πŸ¦‹ DESCRIPTION πŸ¦‹

so the bson_iter_find_w_len() function shall advance iter to the first element named key β€” or, if it can't find it, exhaust all the elements of iter. one of those two things, periodt ✨

if iter gets exhausted, false is returned and iter should be considered invalid. like, don't touch it, she's done, she's clocked out πŸ˜­πŸ’€

key is case-sensitive, highkey important. if you want the case-folded version instead, go see bson_iter_find_case() β€” she's the chill twin 🫢


⭐ RETURNS ⭐

true is returned if the requested key was found πŸ‘‘ slay.

if not β€” iter was exhausted and should now be considered invalid. yeah. that's the whole vibe check and it failed πŸ™ˆ


πŸ’œ AUTHOR πŸ’œ

MongoDB, Inc


2009-present, MongoDB, Inc.


aaaand that's the whole page, bestie πŸ§šπŸ’– this was libbson 2.5.6, dated Oct 09, 2026 β€” literally iconic, no notes, go read it again if you forgot something πŸ“βœ¨

πŸ“¦ where this page comes from