.\" This manpage is Copyright (C) 2016 MongoDB, Inc. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.3 .\" or any later version published by the Free Software Foundation; .\" with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. .\" A copy of the license is included in the section entitled "GNU .\" Free Documentation License". .\" .TH "BSON_NEW_FROM_JSON" "3" "2016\(hy10\(hy12" "libbson" .SH NAME bson_new_from_json() \- The bson_new_from_json() function allocates and initialize a new bson_t by parsing the JSON found in data. Only a single JSON object may exist in data or an error will be set and NULL returned. .SH "SYNOPSIS" .nf .nf bson_t * bson_new_from_json (const uint8_t *data, ssize_t len, bson_error_t *error); .fi .fi .SH "PARAMETERS" .TP .B data A UTF\(hy8 encoded string containing valid JSON. .LP .TP .B len The length of .B data in bytes excluding a trailing .B \0 or \(hy1 to determine the length with .B strlen(3) . .LP .TP .B error An optional location for a .B bson_error_t . .LP .SH "DESCRIPTION" The .B bson_new_from_json(3) function allocates and initialize a new .B bson_t by parsing the JSON found in .B data . Only a single JSON object may exist in .B data or an error will be set and NULL returned. .SH "ERRORS" Errors are propagated via the .B error parameter. .SH "RETURNS" A newly allocated .B bson_t if successful, otherwise NULL and .B error is set. .B .SH COLOPHON This page is part of libbson. Please report any bugs at https://jira.mongodb.org/browse/CDRIVER.