1BSON_AS_RELAXED_EXTENDED_JSON(3) libbson BSON_AS_RELAXED_EXTENDED_JSON(3)
2
3
4
6 char *
7 bson_as_relaxed_extended_json (const bson_t *bson, size_t *length);
8
10 • bson: A bson_t.
11
12 • length: An optional location for the length of the resulting string.
13
15 The bson_as_relaxed_extended_json() encodes bson as a UTF-8 string in
16 the relaxed MongoDB Extended JSON format.
17
18 The caller is responsible for freeing the resulting UTF-8 encoded
19 string by calling bson_free() with the result.
20
21 If non-NULL, length will be set to the length of the result in bytes.
22
24 If successful, a newly allocated UTF-8 encoded string and length is
25 set.
26
27 Upon failure, NULL is returned.
28
30 char *str = bson_as_relaxed_extended_json (doc, NULL);
31 printf ("%s\n", str);
32 bson_free (str);
33
35 MongoDB, Inc
36
38 2017-present, MongoDB, Inc
39
40
41
42
431.25.1 Nov 08, 2023 BSON_AS_RELAXED_EXTENDED_JSON(3)