BSON_ITER_ARRAY(3)
okay so bestie, this is BSON_ITER_ARRAY(3) from libbson π β the manual page for grabbing the raw buffer of a sub-array out of an iterator, and itβs honestly giving βsmall but mighty.β Letβs get into it. β¨
π SYNOPSIS π
First, the macro that is basically the vibe check:
#define BSON_ITER_HOLDS_ARRAY(iter) (bson_iter_type ((iter)) == BSON_TYPE_ARRAY)
Then the function signature, looking all official and everything:
void
bson_iter_array (const bson_iter_t *iter,
uint32_t *array_len,
const uint8_t **array);
π PARAMETERS π
iterβ abson_iter_t. Thatβs the iterator youβre working with, no cap.array_lenβ a location for the buffer length. Itβs where the length goes, bestie.arrayβ a location for the immutable buffer. Thatβs the spot for the buffer, and yes, itβs immutable.
π« DESCRIPTION π«
bson_iter_array() shall retrieve the raw buffer of a sub-array from iter. Like, the actual raw buffer, from the iterator, for a sub-array. Got it? π
β οΈiterMUST be on an element that is of typeBSON_TYPE_ARRAY. This is not a drill. It literally has to be that type, or youβre not in the right place.
This can be verified with bson_iter_type() or the BSON_ITER_HOLDS_ARRAY() macro. So use one of those to check before you go off, okay? π«Ά
π AUTHOR π
MongoDB, Inc β yes, that MongoDB, Inc. Slay. π
π¦ COPYRIGHT π¦
2009-present, MongoDB, Inc. β periodt. π
okay bye bestie π
β this iconic page comes from libbson version 2.5.6, dated Oct 09, 2026, and itβs called BSON_ITER_ARRAY(3) π
π¦ where this page comes from
- epel 10: libbson-devel 2.5.6-1.el10_3 Β· Apache-2.0 AND ISC AND MIT AND Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms