1BSON_APPEND_VALUE(3) libbson BSON_APPEND_VALUE(3)
2
3
4
6 #define BSON_APPEND_VALUE(b, key, val) \
7 bson_append_value (b, key, (int) strlen (key), (val))
8
9 bool
10 bson_append_value (bson_t *bson,
11 const char *key,
12 int key_length,
13 const bson_value_t *value);
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 • value: A bson_value_t.
24
26 Appends a new field to bson by determining the boxed type in value.
27 This is useful if you want to copy fields between documents but do not
28 know the field type until runtime.
29
31 Returns true if the operation was applied successfully. The function
32 will fail if appending the value grows bson larger than INT32_MAX.
33
35 MongoDB, Inc
36
38 2017-present, MongoDB, Inc
39
40
41
42
431.25.1 Nov 08, 2023 BSON_APPEND_VALUE(3)