BSON_ITER_DECIMAL128(3)

πŸ’… BSON_ITER_DECIMAL128(3) πŸ’…

okay so bestie, welcome to the libbson corner of the manual β€” section 3, we're deep in library-function territory, and this one is genuinely a little icon. sit down, grab a strawberry πŸ“, and let's get into it.


✨ SYNOPSIS ✨

here's the whole vibe, verbatim, no cap:

#define BSON_ITER_HOLDS_DECIMAL128(iter) \
   (bson_iter_type ((iter)) == BSON_TYPE_DECIMAL128)

bool
bson_iter_decimal128 (const bson_iter_t *iter, /* IN */
                      bson_decimal128_t *dec); /* OUT */

so you've got a macro that does your vibe check for you (BSON_ITER_HOLDS_DECIMAL128 β€” literally just compares bson_iter_type against BSON_TYPE_DECIMAL128), and then the actual function bson_iter_decimal128 which takes your iterator and an out-param. icon behavior. 🫢


πŸŽ€ PARAMETERS πŸŽ€

  • iter β€” a bson_iter_t. your iterator. the main character of this whole operation, honestly. πŸ‘‘
  • dec β€” a location for a bson_decimal128_t. this is where the value lands once the function does its thing. think of it as the little velvet cushion the decimal gets placed on. ✨

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so what does it actually do? it fetches the value out of a BSON_TYPE_DECIMAL128 field. periodt. that's the whole job. πŸ’…

but listen β€” you should verify that this is a BSON_TYPE_DECIMAL128 field before calling this function. don't just roll up assuming. do the vibe check first. fr fr, no cap, this is the one thing you actually need to remember here. πŸ™ˆ


πŸ”₯ RETURNS πŸ”₯

  • true β€” if type was BSON_TYPE_DECIMAL128. slay, it worked, you ate. πŸŽ‰
  • false β€” otherwise. not today bestie. 😭

🌸 AUTHOR 🌸

MongoDB, Inc β€” the legends themselves. πŸ‘‘


2009-present, MongoDB, Inc. β€” like, they've been holding it down since 2009 and they're still here. iconic longevity. ⭐


aaaand that's the whole page, bestie!! πŸ§šπŸ’œ

cute little sign-off to close it out: this was libbson version 2.5.6, dated Oct 09, 2026, page BSON_ITER_DECIMAL128(3) β€” so if you're reading this from the future, hi, you're exactly on time. see you in the next manpage, mwah πŸ’‹πŸ¦‹

πŸ“¦ where this page comes from