BSON_ARRAY_BUI...VECTOR_ELEMENTS(3)

πŸ“¦
version 2.5.6 Β· 3 versions
, in epel 10

πŸ’… 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 valid bson_array_builder_t. has to be valid, like, actually valid. take care of her πŸ’–
  • iter β€” a bson_iter_t pointing 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 bson larger than INT32_MAX 😭 (yeah. that limit. respect it.)
  • iter doesn'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 πŸ’œ

2009-present, MongoDB, Inc. β€” all the years, all the rights, all the slay 🌈


and that's the page! brought to you by libbson version 2.5.6, dated Oct 09, and yes the header line got cut off at BSON_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