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

Function PgbsonInitFromBuffer

pg_documentdb_core/src/io/pgbson.c:528–539  ·  view source on GitHub ↗

* Initializes a pgbson structure from a data buffer */

Source from the content-addressed store, hash-verified

526 * Initializes a pgbson structure from a data buffer
527 */
528pgbson *
529PgbsonInitFromBuffer(const char *buffer, uint32_t bufferLength)
530{
531 bson_iter_t bson;
532 if (!bson_iter_init_from_data(&bson, (const uint8_t *) buffer, bufferLength))
533 {
534 ereport(ERROR, (errcode(ERRCODE_DOCUMENTDB_BADVALUE),
535 errmsg("invalid input syntax for BSON")));
536 }
537
538 return CreatePgbsonfromBsonBytes((const uint8_t *) buffer, bufferLength);
539}
540
541
542/*

Callers 7

bson_recvFunction · 0.85
HandleProjectFindFunction · 0.85
HandleInverseMatchFunction · 0.85
bsonaggvalue_recvFunction · 0.85

Calls 1

Tested by

no test coverage detected