1BSON_APPEND_BINARY(3) Libbson BSON_APPEND_BINARY(3)
2
3
4
6 bson_append_binary - bson_append_binary()
7
9 #define BSON_APPEND_BINARY(b, key, subtype, val, len) \
10 bson_append_binary (b, key, (int) strlen (key), subtype, val, len)
11
12 bool
13 bson_append_binary (bson_t *bson,
14 const char *key,
15 int key_length,
16 bson_subtype_t subtype,
17 const uint8_t *binary,
18 uint32_t length);
19
21 · bson: A bson_t.
22
23 · key: The key name.
24
25 · key_length: The length of key in bytes or -1 to use strlen().
26
27 · subtype: A bson_subtype_t indicating the binary subtype.
28
29 · binary: A buffer to embed as binary data. Must not be NULL.
30
31 · length: The length of buffer in bytes.
32
34 The bson_append_binary() function shall append a new element to bson
35 containing the binary data provided.
36
38 Returns true if the operation was applied successfully. The function
39 will fail if appending binary grows bson larger than INT32_MAX.
40
42 MongoDB, Inc
43
45 2017-present, MongoDB, Inc
46
47
48
49
501.14.0 Feb 22, 2019 BSON_APPEND_BINARY(3)