1BSON_APPEND_DOCUMENT_BEGIN(3) libbson BSON_APPEND_DOCUMENT_BEGIN(3)
2
3
4
6 bson_append_document_begin - bson_append_document_begin()
7
9 #define BSON_APPEND_DOCUMENT_BEGIN(b, key, child) \
10 bson_append_document_begin (b, key, (int) strlen (key), child)
11
12 bool
13 bson_append_document_begin (bson_t *bson,
14 const char *key,
15 int key_length,
16 bson_t *child);
17
19 • bson: A bson_t.
20
21 • key: An ASCII C string containing the name of the field.
22
23 • key_length: The length of key in bytes, or -1 to determine the length
24 with strlen().
25
26 • child: An uninitialized bson_t to be initialized as the sub-document.
27
29 The bson_append_document_begin() function shall begin appending a
30 sub-document to bson. Use child to add fields to the sub-document. When
31 completed, call bson_append_document_end() to complete the element.
32
33 child MUST be an uninitialized bson_t to avoid leaking memory.
34
36 Returns true if the operation was applied successfully. The function
37 will fail if bson must grow larger than INT32_MAX.
38
40 MongoDB, Inc
41
43 2017-present, MongoDB, Inc
44
45
46
47
481.23.1 Oct 20, 2022 BSON_APPEND_DOCUMENT_BEGIN(3)