BSON_ITER_OID(3)

πŸ’… BSON_ITER_OID πŸ’…

okay so bestie, welcome to bson_iter_oid β€” that's section 3 of the libbson manual, and honestly? she's a short one but she's iconic. let's get into it 🫢


✨ SYNOPSIS ✨

#define BSON_ITER_HOLDS_OID(iter) (bson_iter_type ((iter)) == BSON_TYPE_OID)

const bson_oid_t *
bson_iter_oid (const bson_iter_t *iter);

literally two things and both are perfect, no notes πŸ’–


πŸŽ€ PARAMETERS πŸŽ€

  • iter β€” a bson_iter_t. that's it. that's the whole cast of characters πŸ¦‹

🌸 DESCRIPTION 🌸

so the way this works is: bson_iter_oid fetches the bson_oid_t for a BSON_TYPE_OID element. slay. but β€” and this part is important, bestie, don't skip it β€” you should verify it's an element of type BSON_TYPE_OID before calling this function. like, vibe check your iterator first, okay? 😭 that's literally what the BSON_ITER_HOLDS_OID(iter) macro up in the synopsis is for, iykyk πŸ‘‘


πŸ¦‹ RETURNS πŸ¦‹

a bson_oid_t that should not be modified or freed β€” ngl it's not yours, it's giving borrowed-and-you-must-not-touch. look respectfully and move on πŸ™ˆβœ¨


⭐ AUTHOR ⭐

MongoDB, Inc β€” yeah, the MongoDB girlies wrote this one πŸ‘‘


2009-present, MongoDB, Inc. β€” protect the intellectual property, periodt πŸ’…


and that's the whole page, bestie!! you ate that reading. this was libbson 2.5.6, dated Oct 09, 2026 β€” write it down, take a picture, it'll last longer πŸŽ€πŸ“ΈπŸ’œ

πŸ“¦ where this page comes from