1BSON_AS_CANONICAL_EXTENDED_JSON(3) Libbson BSON_AS_CANONICAL_EXTENDED_JSON(3)
2
3
4
6 bson_as_canonical_extended_json - bson_as_canonical_extended_json()
7
9 char *
10 bson_as_canonical_extended_json (const bson_t *bson, size_t *length);
11
13 · bson: A bson_t.
14
15 · length: An optional location for the length of the resulting string.
16
18 The bson_as_canonical_extended_json() encodes bson as a UTF-8 string in
19 the canonical MongoDB Extended JSON format.
20
21 The caller is responsible for freeing the resulting UTF-8 encoded
22 string by calling bson_free() with the result.
23
24 If non-NULL, length will be set to the length of the result in bytes.
25
27 If successful, a newly allocated UTF-8 encoded string and length is
28 set.
29
30 Upon failure, NULL is returned.
31
33 char *str = bson_as_canonical_extended_json (doc, NULL);
34 printf ("%s\n", str);
35 bson_free (str);
36
38 MongoDB, Inc
39
41 2017-present, MongoDB, Inc
42
43
44
45
461.14.0 Feb 22, 2019BSON_AS_CANONICAL_EXTENDED_JSON(3)