1BSON_APPEND_SYMBOL(3) libbson BSON_APPEND_SYMBOL(3)
2
3
4
6 #define BSON_APPEND_SYMBOL(b, key, val) \
7 bson_append_symbol (b, key, (int) strlen (key), val, (int) strlen (val))
8
9 bool
10 bson_append_symbol (bson_t *bson,
11 const char *key,
12 int key_length,
13 const char *value,
14 int length);
15
17 • bson: A bson_t.
18
19 • key: An ASCII C string containing the name of the field.
20
21 • key_length: The length of key in bytes, or -1 to determine the length
22 with strlen().
23
24 • value: The symbol.
25
26 • length: A length of symbol in bytes, or -1 to determine the length
27 with strlen().
28
30 Appends a new field to bson of type BSON_TYPE_SYMBOL. This BSON type is
31 deprecated and should not be used in new code.
32
33 Due to legacy behavior, passing NULL for value appends a null value,
34 not a symbol value. To append a null value directly, prefer using
35 bson_append_null().
36
38 Returns true if the operation was applied successfully. The function
39 will fail if appending the value grows bson larger than INT32_MAX.
40
42 MongoDB, Inc
43
45 2017-present, MongoDB, Inc
46
47
48
49
501.25.1 Nov 08, 2023 BSON_APPEND_SYMBOL(3)