1BSON_APPEND_ARRAY(3) libbson BSON_APPEND_ARRAY(3)
2
3
4
6 #define BSON_APPEND_ARRAY(b, key, val) \
7 bson_append_array (b, key, (int) strlen (key), val)
8
9 bool
10 bson_append_array (bson_t *bson,
11 const char *key,
12 int key_length,
13 const bson_t *array);
14
16 • bson: A bson_t.
17
18 • key: An ASCII C string containing the name of the field.
19
20 • key_length: The length of key in bytes, or -1 to determine the length
21 with strlen().
22
23 • array: A bson_t.
24
26 The bson_append_array() function shall append array to bson using the
27 specified key. The type of the field will be an array, but it is the
28 responsibility of the caller to ensure that the keys of array are prop‐
29 erly formatted with string keys such as "0", "1", "2" and so forth.
30
32 Returns true if the operation was applied successfully. The function
33 fails if appending the array grows bson larger than INT32_MAX.
34
35 SEE ALSO:
36 bson_array_builder_t
37
38
40 MongoDB, Inc
41
43 2017-present, MongoDB, Inc
44
45
46
47
481.25.1 Nov 08, 2023 BSON_APPEND_ARRAY(3)