BSON_APPEND_DOUBLE(3)

hey bestie πŸ’– welcome to the BSON_APPEND_DOUBLE(3) page, aka the libbson moment where we append a double to a BSON document and move on with our lives. this page covers both the macro bestie BSON_APPEND_DOUBLE() and the function bson_append_double(), and honestly? it's giving "tiny API, big slay" ✨


✨ SYNOPSIS ✨

          #define BSON_APPEND_DOUBLE(b, key, val) \
             bson_append_double (b, key, (int) strlen (key), val)

          bool
          bson_append_double (bson_t *bson,
                              const char *key,
                              int key_length,
                              double value);

πŸŽ€ PARAMETERS πŸŽ€

  • bson β€” a bson_t. that's the document bestie we're adding to πŸ’…
  • key β€” an ASCII C string containing the name of the field. it's the little label for your element 🏷️
  • key_length β€” the length of key in bytes, or -1 to determine the length with strlen(). yes, -1 is the "bestie, you figure it out" option 😌
  • value β€” a double value to append. the actual number going in πŸ”₯

🌸 DESCRIPTION 🌸

the bson_append_double() function shall append a new element to a bson document of type double. that's the vibe: new element, type double, done ✨


πŸ”₯ RETURNS πŸ”₯

returns true if the operation was applied successfully β€” slay βœ…. the function will fail if appending value grows bson larger than INT32_MAX β€” that's the limit, and crossing it means failure, no cap πŸ’€.


πŸ‘‘ AUTHOR πŸ‘‘

MongoDB, Inc


2009-present, MongoDB, Inc.


that's the whole page bestie 🫢 it's from libbson version 2.5.6, dated Oct 09, 2026 β€” go forth and append those doubles, periodt πŸ’…βœ¨

πŸ“¦ where this page comes from