jstests/sharding/change_streams/change_stream_lookup_preimage_with_resharding.js
// Verifies that the change streams cursor 'csCursor' observes the expected events.
Verifies that the change streams cursor 'csCursor' observes the expected events.
Verifies that the change streams cursor ' csCursor ' observes the expected events .
function verifyChangeStreamEvents(csCursor, events) {
    events.forEach(expectedEvent => {
        assert.soon(() => csCursor.hasNext());
        const event = csCursor.next();
        assert.eq(event.operationType, expectedEvent.opType, event);
        assert.eq(event.documentKey._id, expectedEvent.id, event);
        assert.eq(event.fullDocumentBeforeChange.annotation, expectedEvent.prevAnnotation, event);
        if (event.operationType == "update") {
            assert.eq(event.fullDocument.annotation, expectedEvent.curAnnotation, event);
        }
    });
}
function verifyChangeStreamEvents ( csCursor , events ) { events . forEach ( expectedEvent => { assert . soon ( ( ) => csCursor . hasNext ( ) ) ; const event = csCursor . next ( ) ; assert . eq ( event . operationType , expectedEvent . opType , event ) ; assert . eq ( event . documentKey . _id , expectedEvent . id , event ) ; assert . eq ( event . fullDocumentBeforeChange . annotation , expectedEvent . prevAnnotation , event ) ; if ( event . operationType == "update" ) { assert . eq ( event . fullDocument . annotation , expectedEvent . curAnnotation , event ) ; } } ) ; }
Verifies that the change streams cursor 'csCursor' observes the expected events.
Verifies that the change streams cursor ' csCursor ' observes the expected events .