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

Function BsonValueToDocumentPgbson

pg_documentdb_core/src/io/pgbson.c:1795–1803  ·  view source on GitHub ↗

* Converts a bson_value_t into a serializable pgbson bson document using the format * { "": } - this is equivalent to writing a single pgbson_element with the empty path */

Source from the content-addressed store, hash-verified

1793 * { "": <value> } - this is equivalent to writing a single pgbson_element with the empty path
1794 */
1795pgbson *
1796BsonValueToDocumentPgbson(const bson_value_t *value)
1797{
1798 pgbson_writer writer;
1799 PgbsonWriterInit(&writer);
1800 PgbsonWriterAppendValue(&writer, "", 0, value);
1801 pgbson *bson = PgbsonWriterGetPgbson(&writer);
1802 return bson;
1803}
1804
1805
1806/* --------------------------------------------------------- */

Calls 3

PgbsonWriterInitFunction · 0.85
PgbsonWriterAppendValueFunction · 0.85
PgbsonWriterGetPgbsonFunction · 0.85

Tested by

no test coverage detected