jstests/core/write_change_stream_pit_preimage.js
// Validates the contents of the pre-image collection entry.
Validates the contents of the pre-image collection entry.
Validates the contents of the pre - image collection entry .
function assertValidChangeStreamPreImageDocument(preImage) {
    const oplogEntryCursor = localDB.oplog.rs.find({ts: preImage._id.ts});
    assert(oplogEntryCursor.hasNext());
    const oplogEntry = oplogEntryCursor.next();
    assert.contains(oplogEntry.op, ["u", "d"], oplogEntry);
    assert.eq(preImage._id.nsUUID, oplogEntry.ui);
    assert.eq(preImage._id.applyOpsIndex, 0);
    assert.eq(preImage.operationTime, oplogEntry.wall, oplogEntry);
    if (oplogEntry.hasOwnProperty("o2")) {
        assert.eq(preImage.preImage._id, oplogEntry.o2._id, oplogEntry);
    }
}
function assertValidChangeStreamPreImageDocument ( preImage ) { const oplogEntryCursor = localDB . oplog . rs . find ( { ts : preImage . _id . ts } ) ; assert ( oplogEntryCursor . hasNext ( ) ) ; const oplogEntry = oplogEntryCursor . next ( ) ; assert . contains ( oplogEntry . op , [ "u" , "d" ] , oplogEntry ) ; assert . eq ( preImage . _id . nsUUID , oplogEntry . ui ) ; assert . eq ( preImage . _id . applyOpsIndex , 0 ) ; assert . eq ( preImage . operationTime , oplogEntry . wall , oplogEntry ) ; if ( oplogEntry . hasOwnProperty ( "o2" ) ) { assert . eq ( preImage . preImage . _id , oplogEntry . o2 . _id , oplogEntry ) ; } }
Validates the contents of the pre-image collection entry.
Validates the contents of the pre - image collection entry .
// Pre-images documents are recorded only for update and delete commands.