BSON_APPEND_VE...NT8_FROM_ARRAY(3)
π BSON_APPEND_VECTOR_INT8_FROM_ARRAY(3) π
Okay so bestie, this is the libbson page for BSON_APPEND_VECTOR_INT8_FROM_ARRAY, and it's literally about converting an array into a vector of int8s. It's giving "niche but iconic." Let's get into it. π«Ά
β¨ SYNOPSIS β¨
#define BSON_APPEND_VECTOR_INT8_FROM_ARRAY(b, key, iter, err) \
bson_append_vector_int8_from_array (b, key, (int) strlen (key), iter, err)
bool
bson_append_vector_int8_from_array (bson_t *bson,
const char *key,
int key_length,
const bson_iter_t *iter,
bson_error_t *error);
π PARAMETERS π
bsonβ Abson_t. It's the document you're appending to, bestie. Main character energy.keyβ An ASCII C string containing the name of the field. Like, the field name. No cap.key_lengthβ The length ofkeyin bytes, or-1to determine the length withstrlen(). Slay.iterβ Abson_iter_treferencing array elements that will be converted. It's the iterator, obviously.errorβ Optionalbson_error_tfor detail about conversion failures. Optional but highkey useful. π
π¦ DESCRIPTION π¦
Appends a new field to bson by converting an Array to a Vector of int8 elements. It's literally that simple.
For the conversion to succeed, every item in the Array must be an integer (BSON_TYPE_INT32 or BSON_TYPE_INT64) in the range INT8_MIN (-128) through INT8_MAX (127) inclusive. If any element has an incorrect type or an out-of-range value, the conversion fails with an error message providing details, and no changes are made to bson. Periodt. No partial updates, no messy vibes.
The provided iter must be positioned just prior to the first element of the BSON Array. If your input is a bare BSON Array, set up iter using bson_iter_init(). If the input is within a document field, use bson_iter_recurse().
Lowkey important: that iterator positioning is not a vibe check you can skip. Get it wrong and it's giving chaos. π
π RETURNS π
Returns true if the operation was applied successfully. On error, returns false and writes additional error information to error without modifying bson. The error will have a domain of BSON_ERROR_VECTOR and a code from bson_vector_error_code_t. That's the whole return situation, fr fr.
π AUTHOR π
MongoDB, Inc
π COPYRIGHT π
2009-present, MongoDB, Inc.
Okay bestie, that's the whole page. It's from libbson 2.5.6, dated Oct 09, 2024. Now go forth and slay those int8 vectors. π
β¨
π¦ 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