1BSON_INIT_FROM_JSON(3)              libbson             BSON_INIT_FROM_JSON(3)
2
3
4

NAME

6       bson_init_from_json - bson_init_from_json()
7

SYNOPSIS

9          bool
10          bson_init_from_json (bson_t *bson,
11                               const char *data,
12                               ssize_t len,
13                               bson_error_t *error);
14

PARAMETERS

16bson: Pointer to an uninitialized bson_t.
17
18data: A UTF-8 encoded string containing valid JSON.
19
20len: The length of data in bytes excluding a trailing \0 or -1 to de‐
21         termine the length with strlen().
22
23error: An optional location for a bson_error_t.
24

DESCRIPTION

26       The bson_init_from_json() function will  initialize  a  new  bson_t  by
27       parsing  the JSON found in data. Only a single JSON object may exist in
28       data or an error will be set and false returned.
29
30       data should be in MongoDB Extended JSON format.
31

ERRORS

33       Errors are propagated via the error parameter.
34

RETURNS

36       Returns true if valid JSON was parsed, otherwise  false  and  error  is
37       set.  On  success,  bson is initialized and must be freed with bson_de‐
38       stroy, otherwise bson is invalid.
39

AUTHOR

41       MongoDB, Inc
42
44       2017-present, MongoDB, Inc
45
46
47
48
491.20.0                           Nov 18, 2021           BSON_INIT_FROM_JSON(3)
Impressum