jstests/concurrency/fsm_workload_helpers/update_in_transaction_states.js
/**
 * Sends a multi=false update with an exact match on _id for a random document assigned to this
 * thread, which should be sent to all shards.
 */
Sends a multi=false update with an exact match on _id for a random document assigned to this
thread, which should be sent to all shards.
Sends a multi = false update with an exact match on _id for a random document assigned to this thread which should be sent to all shards .
function exactIdUpdate(db, collName, session, idToUpdate) {
    const collection = session.getDatabase(db.getName()).getCollection(collName);
    withTxnAndAutoRetry(session, () => {
        assertWhenOwnColl.commandWorked(
            collection.update({_id: idToUpdate}, {$inc: {counter: 1}}, {multi: false}));
    });
    expectedCounters[collName][idToUpdate] += 1;
}
function exactIdUpdate ( db , collName , session , idToUpdate ) { const collection = session . getDatabase ( db . getName ( ) ) . getCollection ( collName ) ; withTxnAndAutoRetry ( session , ( ) => { assertWhenOwnColl . commandWorked ( collection . update ( { _id : idToUpdate } , { $inc : { counter : 1 } } , { multi : false } ) ) ; } ) ; expectedCounters [ collName ] [ idToUpdate ] += 1 ; }
Sends a multi=false update with an exact match on _id for a random document assigned to this
 thread, which should be sent to all shards.
Sends a multi = false update with an exact match on _id for a random document assigned to this thread which should be sent to all shards .
// Update the expected counter for the targeted id.