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

Function PgbsonArrayWriterStartArray

pg_documentdb_core/src/io/pgbson.c:1150–1166  ·  view source on GitHub ↗

* Starts writing a nested array in the context of a bson array */

Source from the content-addressed store, hash-verified

1148 * Starts writing a nested array in the context of a bson array
1149 */
1150void
1151PgbsonArrayWriterStartArray(pgbson_array_writer *writer, pgbson_array_writer *childWriter)
1152{
1153 char buffer[20];
1154 const char *key;
1155 uint32_t keyLength = bson_uint32_to_string(writer->index, &key, buffer,
1156 sizeof buffer);
1157 if (!bson_append_array_begin(&(writer->innerBson), key, keyLength,
1158 &(childWriter->innerBson)))
1159 {
1160 ereport(ERROR, (errcode(ERRCODE_DOCUMENTDB_BADVALUE), errmsg(
1161 "adding ArrayWriterStartArray value: failed due to value being too large"))
1162 );
1163 }
1164
1165 childWriter->index = 0;
1166}
1167
1168
1169/*

Callers 3

EvaluateRedactArrayFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected