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

Function bson_out

pg_documentdb_core/src/io/bson_io.c:81–97  ·  view source on GitHub ↗

* bson_out converts a binary serialized bson document to the extended json text format. */

Source from the content-addressed store, hash-verified

79 * bson_out converts a binary serialized bson document to the extended json text format.
80 */
81Datum
82bson_out(PG_FUNCTION_ARGS)
83{
84 pgbson *arg = PG_GETARG_PGBSON(0);
85
86 const char *jsonString;
87 if (BsonTextUseJsonRepresentation)
88 {
89 jsonString = PgbsonToCanonicalExtendedJson(arg);
90 }
91 else
92 {
93 jsonString = PgbsonToHexadecimalString(arg);
94 }
95
96 PG_RETURN_CSTRING(jsonString);
97}
98
99
100/*

Callers

nothing calls this directly

Calls 2

Tested by

no test coverage detected