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

Function BsonUpdateDocument

pg_documentdb/src/update/bson_update.c:411–426  ·  view source on GitHub ↗

* BsonUpdateDocument contains the internal implementation of bson_update_document. * returns NULL if no update is needed. */

Source from the content-addressed store, hash-verified

409 * returns NULL if no update is needed.
410 */
411pgbson *
412BsonUpdateDocument(pgbson *sourceDocument, const bson_value_t *updateSpec,
413 const bson_value_t *querySpec, const bson_value_t *arrayFilters,
414 const bson_value_t *variableSpec)
415{
416 BsonUpdateMetadata metadata = { 0 };
417 BsonUpdateSource updateSource = { 0 };
418
419 /* An empty document will be processed as an upsert operation. */
420 bool buildSourceDocOnUpsert = IsPgbsonEmptyDocument(sourceDocument);
421
422 BuildBsonUpdateMetadata(&metadata, updateSpec, querySpec, arrayFilters,
423 variableSpec, buildSourceDocOnUpsert);
424 return BsonUpdateDocumentCore(sourceDocument, updateSpec, &metadata, &updateSource,
425 NULL);
426}
427
428
429/*

Callers 2

UpdateOneInternalFunction · 0.85
UpsertDocumentFunction · 0.85

Calls 3

IsPgbsonEmptyDocumentFunction · 0.85
BuildBsonUpdateMetadataFunction · 0.85
BsonUpdateDocumentCoreFunction · 0.85

Tested by

no test coverage detected