jstests/change_streams/create_event_from_chunk_migration.js
// Test that create and createIndexes events are observable with migration.
Test that create and createIndexes events are observable with migration.
Test that create and createIndexes events are observable with migration .
function validateCreateEventsFromChunkMigration() {
    prepareCollection();
    let pipeline = [
        {$changeStream: {showExpandedEvents: true, showSystemEvents: true}},
    ];
    let cursor = test.startWatchingChanges({pipeline, collection: collName});
    assert.commandWorked(
        db.adminCommand({moveChunk: collNS, find: {_id: 0}, to: st.shard1.shardName}));
    test.assertNextChangesEqual({
        cursor: cursor,
        expectedChanges: {
            operationType: "create",
            ns: ns,
        }
    });
    test.assertNextChangesEqual({
        cursor: cursor,
        expectedChanges: {
            operationType: "createIndexes",
            ns: ns,
        }
    });
}
function validateCreateEventsFromChunkMigration ( ) { prepareCollection ( ) ; let pipeline = [ { $changeStream : { showExpandedEvents : true , showSystemEvents : true } } , ] ; let cursor = test . startWatchingChanges ( { pipeline , collection : collName } ) ; assert . commandWorked ( db . adminCommand ( { moveChunk : collNS , find : { _id : 0 } , to : st . shard1 . shardName } ) ) ; test . assertNextChangesEqual ( { cursor : cursor , expectedChanges : { operationType : "create" , ns : ns , } } ) ; test . assertNextChangesEqual ( { cursor : cursor , expectedChanges : { operationType : "createIndexes" , ns : ns , } } ) ; }
Test that create and createIndexes events are observable with migration.
Test that create and createIndexes events are observable with migration .