BSON_ITER_OVERWRITE_DATE_TIME(3)

πŸ’… BSON_ITER_OVERWRITE_DATE_TIME πŸ’…

okay bestie, so this is the BSON_ITER_OVERWRITE_DATE_TIME(3) page from libbson, and honestly? it's a little baddie with one job and she does it. sit down, get comfy, let's go 🫢


✨ SYNOPSIS ✨

void
bson_iter_overwrite_date_time (bson_iter_t *iter, int64_t value);

like, that's the whole vibe. two args, no return value, no drama πŸŽ€


🌸 PARAMETERS 🌸

  • iter β€” a bson_iter_t. yes, that kind of iterator. your little pointer bestie πŸ’«
  • value β€” the date and time, specified in milliseconds since the UNIX epoch. milliseconds!! not seconds, not nanos, don't come at her with the wrong units fr fr 😭

πŸ¦‹ DESCRIPTION πŸ¦‹

so the bson_iter_overwrite_date_time() function shall overwrite the contents of a BSON_TYPE_DATE_TIME element in place. in place, bestie. no copies, no new document, she just reaches in and swaps the value πŸ’…βœ¨

⚠️ but hear me now: this may only be done when the underlying bson document allows mutation. if it doesn't, that's a whole situation and you do NOT want it 🫠

and this one's important β€” it is a programming error to call this function when iter is not observing an element of type BSON_TYPE_DATE_TIME. like, the iterator has to actually be looking at a date-time element, okay? check your types first, i'm begging πŸ™ˆπŸ’€


πŸ‘‘ AUTHOR πŸ‘‘

MongoDB, Inc β€” the icons themselves ✨


2009-present, MongoDB, Inc.


aaaand that's the page, bestie!! 🌈 go forth, overwrite those date-times responsibly, and remember: in place only, mutable documents only, right type only. slay πŸŽ€πŸ¦‹πŸ’–

ngl this was libbson 2.5.6, dated Oct 09, 2026 β€” iconic of her, no cap πŸ’…β­

πŸ“¦ where this page comes from