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

Function BuildDeletionSpecList

pg_documentdb/src/commands/delete.c:407–429  ·  view source on GitHub ↗

* BuildDeletionSpecList iterates over an array of delete operations and * builds a Deletion for each object. */

Source from the content-addressed store, hash-verified

405 * builds a Deletion for each object.
406 */
407static List *
408BuildDeletionSpecList(bson_iter_t *deleteArrayIter, const bson_value_t *variableSpec)
409{
410 List *deletions = NIL;
411
412 while (bson_iter_next(deleteArrayIter))
413 {
414 StringInfo fieldNameStr = makeStringInfo();
415 int arrIdx = list_length(deletions);
416 appendStringInfo(fieldNameStr, "delete.deletes.%d", arrIdx);
417
418 EnsureTopLevelFieldType(fieldNameStr->data, deleteArrayIter, BSON_TYPE_DOCUMENT);
419
420 bson_iter_t deleteOperationIter;
421 bson_iter_recurse(deleteArrayIter, &deleteOperationIter);
422
423 DeletionSpec *deletion = BuildDeletionSpec(&deleteOperationIter, variableSpec);
424
425 deletions = lappend(deletions, deletion);
426 }
427
428 return deletions;
429}
430
431
432/*

Callers 1

Calls 2

EnsureTopLevelFieldTypeFunction · 0.85
BuildDeletionSpecFunction · 0.85

Tested by

no test coverage detected