BSON_ARRAY_BUI...VECTOR_ELEMENTS(3)
π BSON_ARRAY_BUI...VECTOR_ELEMENTS(3) β a libbson moment
okay so bestie, you know how libbson has a whole page for bson_array_builder_append_vector_elements and the name is so long it literally gets chopped in the header as BSON_ARRAY_BUI...VECTOR_ELEMENTS? yeah. that's the one. it lives in libbson, and it's here to turn your Vector into a plain array. slay.
β¨ SYNOPSIS β¨
bool
bson_array_builder_append_vector_elements (bson_array_builder_t *builder,
const bson_iter_t *iter);
that's the whole signature, no cap. copy it exactly, she's built different π«Ά
π PARAMETERS π
builderβ a validbson_array_builder_t. has to be valid, like, actually valid. take care of her πiterβ abson_iter_tpointing to any supported BSON Binary Vector subtype field. any of them. she's flexible like that β¨
π¦ DESCRIPTION π¦
so what does she do? she converts the Vector that iter points at into elements of a plain BSON Array, and writes all of that into builder. it's giving... transformation. main character energy π₯
and here's the cute part: the conversion is polymorphic. meaning a converted element type gets chosen based on the type of the input Vector. you don't pick it β the Vector picks it. iykyk π
for the deets on that, go see the type-specific versions of this function. they're linked below and they ate.
π RETURNS π
returns true if the operation was applied successfully. periodt β
but bestie, she's not invincible. the function fails if:
- appending the array grows
bsonlarger thanINT32_MAXπ (yeah. that limit. respect it.) iterdoesn't point to a valid recognized Vector type π (like, she has to know what she's looking at)
ngl, check your types before you call her. it's giving "just be valid" and honestly? fair.
πΈ SEE ALSO πΈ
bson_append_array_from_vector()bson_array_builder_append_vector_int8_elements()bson_array_builder_append_vector_float32_elements()bson_array_builder_append_vector_packed_bit_elements()
go read those too, they're iconic in their own right π
π§ AUTHOR π§
MongoDB, Inc. the ones who brought you this whole vibe π
β COPYRIGHT β
2009-present, MongoDB, Inc. β all the years, all the rights, all the slay π
and that's the page! brought to you by libbson version2.5.6, datedOct 09, and yes the header line got cut off atBSON_ARRAY_BUI...VECTOR_ELEMENTS(3)because the name simply could not fit and honestly same. drink water, read your manpages, bye bestie ππ¦β¨
π¦ 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