1BSON_APPEND_ARRAY_BEGIN(3) libbson BSON_APPEND_ARRAY_BEGIN(3)
2
3
4
6 #define BSON_APPEND_ARRAY_BEGIN(b, key, child) \
7 bson_append_array_begin (b, key, (int) strlen (key), child)
8
9 bool
10 bson_append_array_begin (bson_t *bson,
11 const char *key,
12 int key_length,
13 bson_t *child);
14
16 • bson: A bson_t.
17
18 • key: A string containing the name for the key.
19
20 • key_length: The length of key or -1 to call strlen().
21
22 • child: A bson_t.
23
25 The bson_append_array_begin() function shall begin appending an array
26 field to bson. This allows for incrementally building a sub-array. Do‐
27 ing so will generally yield better performance as you will serialize to
28 a single buffer. When done building the sub-array, the caller MUST call
29 bson_append_array_end().
30
31 For generating array element keys, see bson_uint32_to_string().
32
33 Consider using bson_array_builder_t to append an array without needing
34 to generate array element keys.
35
37 Returns true if the operation was applied successfully. The function
38 will fail if appending the array grows bson larger than INT32_MAX.
39
40 SEE ALSO:
41 bson_array_builder_t
42
43
45 MongoDB, Inc
46
48 2017-present, MongoDB, Inc
49
50
51
52
531.25.1 Nov 08, 2023 BSON_APPEND_ARRAY_BEGIN(3)