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

Function ConvertPgbsonToBsonValue

pg_documentdb_core/src/io/pgbson.c:662–672  ·  view source on GitHub ↗

* ConvertPgbsonToBsonValue returns a bson value based on given document. * * That means, it doesn't copy raw bytes of given document but returns a * bson value view for it. */

Source from the content-addressed store, hash-verified

660 * bson value view for it.
661 */
662bson_value_t
663ConvertPgbsonToBsonValue(const pgbson *document)
664{
665 bson_value_t value = {
666 .value_type = BSON_TYPE_DOCUMENT,
667 .value.v_doc.data = (uint8_t *) VARDATA_ANY(document),
668 .value.v_doc.data_len = (uint32_t) VARSIZE_ANY_EXHDR(document)
669 };
670
671 return value;
672}
673
674
675/*

Calls

no outgoing calls

Tested by

no test coverage detected