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

Function PgbsonArrayWriterStartDocument

pg_documentdb_core/src/io/pgbson.c:1258–1272  ·  view source on GitHub ↗

* Appends a document to a nested array writer and returns the nested document writer. */

Source from the content-addressed store, hash-verified

1256 * Appends a document to a nested array writer and returns the nested document writer.
1257 */
1258void
1259PgbsonArrayWriterStartDocument(pgbson_array_writer *writer, pgbson_writer *childWriter)
1260{
1261 char buffer[20];
1262 const char *key;
1263 uint32_t keyLength = bson_uint32_to_string(writer->index, &key, buffer,
1264 sizeof buffer);
1265 if (!bson_append_document_begin(&(writer->innerBson), key, keyLength,
1266 &(childWriter->innerBson)))
1267 {
1268 ereport(ERROR, (errcode(ERRCODE_DOCUMENTDB_BADVALUE), errmsg(
1269 "adding ArrayWriterStartDocument value: failed due to value being too large"))
1270 );
1271 }
1272}
1273
1274
1275/*

Callers 15

WriteShardListFunction · 0.85
CurrentOpWorkerCoreFunction · 0.85
BuildResponseMessageFunction · 0.85
connection_statusFunction · 0.85
WriteRolesFunction · 0.85
WriteRoleResponseFunction · 0.85
GenerateIndexExprStrFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected