MCPcopy Create free account
hub / github.com/documentdb/documentdb / PgbsonInitFromJson

Function PgbsonInitFromJson

pg_documentdb_core/src/io/pgbson.c:194–208  ·  view source on GitHub ↗

* Initializes a pgbson structure from an extended json * syntax string. */

Source from the content-addressed store, hash-verified

192 * syntax string.
193 */
194pgbson *
195PgbsonInitFromJson(const char *jsonString)
196{
197 bson_t bson;
198 bson_error_t error;
199 bool parseResult = bson_init_from_json(&bson, jsonString, -1, &error);
200 if (!parseResult)
201 {
202 ereport(ERROR, (errcode(ERRCODE_DOCUMENTDB_BADVALUE), errmsg(
203 "invalid input syntax JSON for BSON: Code: '%d', Message '%s'",
204 error.code, error.message)));
205 }
206
207 return CreatePgbsonfromBson_t(&bson, true /* destroyDocument */);
208}
209
210
211/*

Callers 13

bson_inFunction · 0.85
bson_json_to_bsonFunction · 0.85
AddIndexBuildsFunction · 0.85
RunQueryOnAllServerNodesFunction · 0.85
FillCompositePathSpecFunction · 0.85
FillWeightsSpecFunction · 0.85
ValidateWeightsSpecFunction · 0.85

Calls 1

CreatePgbsonfromBson_tFunction · 0.85

Tested by 1