jstests/concurrency/fsm_workload_helpers/delete_in_transaction_states.js
/**
 * Sends a multi=true delete without the shard key that targets all documents assigned to this
 * thread, which should be sent to all shards.
 */
Sends a multi=true delete without the shard key that targets all documents assigned to this
thread, which should be sent to all shards.
Sends a multi = true delete without the shard key that targets all documents assigned to this thread which should be sent to all shards .
function multiDelete(db, collName, session, tid) {
    if (!expectedDocuments[collName].length) {
        print('This thread owns no more documents for collection ' + db[collName] +
              ', skipping multiDelete stage');
        return;
    }
    const groupIdToDelete = getNextGroupIdForDelete(collName);
    const collection = session.getDatabase(db.getName()).getCollection(collName);
    withTxnAndAutoRetry(session, () => {
        assertWhenOwnColl.commandWorked(
            collection.remove({tid: tid, groupId: groupIdToDelete}, {multi: true}));
    });
    expectedDocuments[collName] = expectedDocuments[collName].filter(obj => {
        return obj.groupId !== groupIdToDelete;
    });
}
function multiDelete ( db , collName , session , tid ) { if ( ! expectedDocuments [ collName ] . length ) { print ( 'This thread owns no more documents for collection ' + db [ collName ] + ', skipping multiDelete stage' ) ; return ; } const groupIdToDelete = getNextGroupIdForDelete ( collName ) ; const collection = session . getDatabase ( db . getName ( ) ) . getCollection ( collName ) ; withTxnAndAutoRetry ( session , ( ) => { assertWhenOwnColl . commandWorked ( collection . remove ( { tid : tid , groupId : groupIdToDelete } , { multi : true } ) ) ; } ) ; expectedDocuments [ collName ] = expectedDocuments [ collName ] . filter ( obj => { return obj . groupId !== groupIdToDelete ; } ) ; }
Sends a multi=true delete without the shard key that targets all documents assigned to this
 thread, which should be sent to all shards.
Sends a multi = true delete without the shard key that targets all documents assigned to this thread which should be sent to all shards .
// If no documents remain in our partition, there is nothing to do. // Delete a group of documents within those assigned to this thread. // Remove the deleted documents from the in-memory representation.