jstests/concurrency/fsm_workload_helpers/update_in_transaction_states.js
/**
 * Gives each document assigned to this thread a counter value that is tracked in-memory.
 */
Gives each document assigned to this thread a counter value that is tracked in-memory.
Gives each document assigned to this thread a counter value that is tracked in - memory .
function initUpdateInTransactionStates(db, collName, tid) {
    expectedCounters[collName] = expectedCounters[collName] || {};
    db[collName].find({tid: tid}).forEach(doc => {
        expectedCounters[collName][doc._id] = 0;
        assert.commandWorked(db[collName].update({_id: doc._id}, {$set: {counter: 0}}));
    });
}
function initUpdateInTransactionStates ( db , collName , tid ) { expectedCounters [ collName ] = expectedCounters [ collName ] || { } ; db [ collName ] . find ( { tid : tid } ) . forEach ( doc => { expectedCounters [ collName ] [ doc . _id ] = 0 ; assert . commandWorked ( db [ collName ] . update ( { _id : doc . _id } , { $set : { counter : 0 } } ) ) ; } ) ; }
Gives each document assigned to this thread a counter value that is tracked in-memory.
Gives each document assigned to this thread a counter value that is tracked in - memory .
// Assign a default counter value to each document owned by this thread.