jstests/core/write_change_stream_pit_preimage.js
// Validates that the expected pre-images are written while performing ops.
Validates that the expected pre-images are written while performing ops.
Validates that the expected pre - images are written while performing ops .
function assertPreImagesWrittenForOps(db, ops, expectedPreImages) {
    const writtenPreImages = preImagesForOps(db, ops);
    assert.eq(writtenPreImages.length, expectedPreImages.length, writtenPreImages);
    for (let idx = 0; idx < writtenPreImages.length; idx++) {
        assert.eq(writtenPreImages[idx].preImage, expectedPreImages[idx]);
        assertValidChangeStreamPreImageDocument(writtenPreImages[idx]);
    }
    assert.eq(0,
              localDB.oplog.rs.find({op: {'$ne': 'd'}, ns: 'config.system.preimages'}).itcount());
}
function assertPreImagesWrittenForOps ( db , ops , expectedPreImages ) { const writtenPreImages = preImagesForOps ( db , ops ) ; assert . eq ( writtenPreImages . length , expectedPreImages . length , writtenPreImages ) ; for ( let idx = 0 ; idx < writtenPreImages . length ; idx ++ ) { assert . eq ( writtenPreImages [ idx ] . preImage , expectedPreImages [ idx ] ) ; assertValidChangeStreamPreImageDocument ( writtenPreImages [ idx ] ) ; } assert . eq ( 0 , localDB . oplog . rs . find ( { op : { '$ne' : 'd' } , ns : 'config.system.preimages' } ) . itcount ( ) ) ; }
Validates that the expected pre-images are written while performing ops.
Validates that the expected pre - images are written while performing ops .
// Because the pre-images collection is implicitly replicated, validate that writes do not // generate oplog entries, with the exception of deletions.