jstests/concurrency/fsm_workloads/update_array.js
// nModifiedPossibilities: array of allowed values for res.nModified
array of allowed values for res.nModified
array of allowed values for res . nModified
function assertUpdateSuccess(db, res, nModifiedPossibilities) {
            assertAlways.eq(0, res.nUpserted, tojson(res));
            if (isMongod(db) && !isMMAPv1(db)) {
                assertWhenOwnColl.contains(1, nModifiedPossibilities, tojson(res));
                if (db.getMongo().writeMode() === 'commands') {
                    assertWhenOwnColl.contains(res.nModified, nModifiedPossibilities, tojson(res));
                }
            }
            else {
                assertWhenOwnColl.contains(res.nMatched, [0, 1], tojson(res));
                if (db.getMongo().writeMode() === 'commands') {
                    assertWhenOwnColl.contains(res.nModified, [0, 1], tojson(res));
                }
            }
        }
function assertUpdateSuccess ( db , res , nModifiedPossibilities ) { assertAlways . eq ( 0 , res . nUpserted , tojson ( res ) ) ; if ( isMongod ( db ) && ! isMMAPv1 ( db ) ) { assertWhenOwnColl . contains ( 1 , nModifiedPossibilities , tojson ( res ) ) ; if ( db . getMongo ( ) . writeMode ( ) === 'commands' ) { assertWhenOwnColl . contains ( res . nModified , nModifiedPossibilities , tojson ( res ) ) ; } } else { assertWhenOwnColl . contains ( res . nMatched , [ 0 , 1 ] , tojson ( res ) ) ; if ( db . getMongo ( ) . writeMode ( ) === 'commands' ) { assertWhenOwnColl . contains ( res . nModified , [ 0 , 1 ] , tojson ( res ) ) ; } } }
nModifiedPossibilities: array of allowed values for res.nModified
nModifiedPossibilities : array of allowed values for res . nModified
// Zero matches are possible for MMAP v1 because the update will skip a document // that was invalidated during a yield.