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