BSON_ITER_OVERWRITE_OID(3)

✨ BSON_ITER_OVERWRITE_OID ✨

okay bestie, welcome to bson_iter_overwrite_oid β€” a libbson function and honestly? it does exactly one thing and it does it slay πŸ’…


🌸 SYNOPSIS 🌸

void
bson_iter_overwrite_oid (bson_iter_t *iter, const bson_oid_t *value);

that's it, that's the whole signature πŸŽ€


πŸ¦‹ PARAMETERS πŸ¦‹

  • iter β€” A bson_iter_t. your iterator, your main character, the vibe you're working with ✨
  • oid β€” A bson_oid_t. yep, that's literally what the manpage says in the parameter list 🫢

πŸ’– DESCRIPTION πŸ’–

so like. bson_iter_overwrite_oid() shall overwrite the contents of a BSON_TYPE_OID element in place πŸ”₯ no new document, no copy, just β€” poof β€” swapped right where it sits, periodt.

⚠️ heads up bestie: this may only be done when the underlying bson document allows mutation. if it doesn't, that's not a "haha oops" situation, that's a whole problem. πŸ™ˆ

and the one that'll get you if you're not paying attention: it is a programming error to call this function when iter is not observing an element of type BSON_TYPE_OID. not a warning, not a returned error code, a programming error. iykyk 😭 check your type first, fr fr.


πŸ‘‘ AUTHOR πŸ‘‘

MongoDB, Inc 🫢 iconic of them honestly.


2009-present, MongoDB, Inc. β€” slay, long-running, established, we love to see it ⭐


aaand that's the whole page, bestie 🧚 mwah πŸ’‹ this was libbson version 2.5.6, dated Oct 09, 2026 β€” go forth and overwrite responsibly πŸ“πŸ’–

πŸ“¦ where this page comes from