jstests/multiVersion/genericChangeStreams/change_streams_multi_version_transaction.js
// verify that we always see the same set of changes.
verify that we always see the same set of changes.
verify that we always see the same set of changes .
function resumeChangeStreamFromEachToken(mongod, changeStreamDocs, expectedChanges) {
    changeStreamDocs.forEach(function(changeDoc, i) {
        const testDB = mongod.getDB(dbName);
        const resumedCursor = testDB[watchedCollName].watch([], {resumeAfter: changeDoc._id});
        const expectedChangesAfterResumeToken = expectedChanges.slice(i + 1);
        compareChanges(
            expectedChangesAfterResumeToken,
            getChangeStreamResults(resumedCursor, expectedChangesAfterResumeToken.length));
    });
}
function resumeChangeStreamFromEachToken ( mongod , changeStreamDocs , expectedChanges ) { changeStreamDocs . forEach ( function ( changeDoc , i ) { const testDB = mongod . getDB ( dbName ) ; const resumedCursor = testDB [ watchedCollName ] . watch ( [ ] , { resumeAfter : changeDoc . _id } ) ; const expectedChangesAfterResumeToken = expectedChanges . slice ( i + 1 ) ; compareChanges ( expectedChangesAfterResumeToken , getChangeStreamResults ( resumedCursor , expectedChangesAfterResumeToken . length ) ) ; } ) ; }
verify that we always see the same set of changes.
verify that we always see the same set of changes .
// Resuming from document 'i' should return all the documents from 'i' + 1 to the end of // the array.