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

Function PgbsonArrayWriterGetValue

pg_documentdb_core/src/io/pgbson.c:1189–1200  ·  view source on GitHub ↗

* Gets the underlying value pointed to by the current array writer. */

Source from the content-addressed store, hash-verified

1187 * Gets the underlying value pointed to by the current array writer.
1188 */
1189bson_value_t
1190PgbsonArrayWriterGetValue(pgbson_array_writer *writer)
1191{
1192 const uint8_t *bytes = bson_get_data(&writer->innerBson);
1193 bson_value_t value = {
1194 .value_type = BSON_TYPE_ARRAY,
1195 .value.v_doc.data = (uint8_t *) bytes,
1196 .value.v_doc.data_len = writer->innerBson.len
1197 };
1198
1199 return value;
1200}
1201
1202
1203/* Allocates the necessary memory on the target bson_value_t and copies using memcpy the data

Calls

no outgoing calls

Tested by

no test coverage detected