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

Function CallDeleteOne

pg_documentdb/src/commands/delete.c:989–1017  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

987
988
989void
990CallDeleteOne(MongoCollection *collection, DeleteOneParams *deleteOneParams,
991 int64 shardKeyHash, text *transactionId, bool forceInlineWrites,
992 DeleteOneResult *result)
993{
994 /* In single node scenarios (like DocumentDB where we can inline the write, call the internal)
995 * delete functions directly.
996 * Alternatively in a distributed scenario, if the shard is colocated on the current node anyway,
997 * then we don't need to go remote - we can simply call the delete internal functions directly.
998 */
999 if (DefaultInlineWriteOperations || collection->shardTableName[0] != '\0' ||
1000 forceInlineWrites)
1001 {
1002 DeleteOneInternalCore(collection, shardKeyHash, deleteOneParams,
1003 transactionId, result);
1004 }
1005 else
1006 {
1007 /*
1008 * If the cluster supports it, and we need to go remote, call the update worker
1009 * function with the appropriate spec args.
1010 */
1011 pgbsonsequence *docSequence = NULL;
1012 pgbson *workerResult = CallDeleteWorker(collection,
1013 SerializeDeleteOneParams(deleteOneParams),
1014 shardKeyHash, transactionId, docSequence);
1015 DeserializeWorkerDeleteResultForDeleteOne(workerResult, result);
1016 }
1017}
1018
1019
1020static pgbson *

Callers 3

ProcessDeletionFunction · 0.85
DeleteOneObjectIdFunction · 0.85
ProcessFindAndModifySpecFunction · 0.85

Calls 4

DeleteOneInternalCoreFunction · 0.85
CallDeleteWorkerFunction · 0.85
SerializeDeleteOneParamsFunction · 0.85

Tested by

no test coverage detected