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