BSON_ITER_DOCUMENT(3)

πŸ’… BSON_ITER_DOCUMENT(3) β€” libbson says hiii, bestie ✨

🌸 SYNOPSIS 🌸

          #define BSON_ITER_HOLDS_DOCUMENT(iter) \
             (bson_iter_type ((iter)) == BSON_TYPE_DOCUMENT)

          void
          bson_iter_document (const bson_iter_t *iter,
                              uint32_t *document_len,
                              const uint8_t **document);

πŸŽ€ PARAMETERS πŸŽ€

  • iter β€” a bson_iter_t. That’s your iterator bestie. 🫢
  • document_len β€” a location for the length of the document in bytes. Yes, bytes, not vibes. πŸ’…
  • document β€” a location for the document buffer. πŸŽ€

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so the bson_iter_document() function shall retrieve the raw buffer of a sub-document from iter β€” that’s the whole assignment, bestie. πŸ’–

🚨 MUST alert: iter MUST be on an element that is of type BSON_TYPE_DOCUMENT. Uppercase MUST, bestie β€” this is not optional, no cap. 😭

You can verify that with bson_iter_type() or the BSON_ITER_HOLDS_DOCUMENT() macro. Slay. ✨

πŸ‘‘ AUTHOR πŸ‘‘

MongoDB, Inc

2009-present, MongoDB, Inc.

mwah πŸ’‹ β€” this page is from libbson 2.5.6, dated Oct 09, 2026. byeeeee 🫢

πŸ“¦ where this page comes from