jstests/libs/change_stream_rewrite_util.js
// Verifies the number of oplog events read by a particular shard.
Verifies the number of oplog events read by a particular shard.
Verifies the number of oplog events read by a particular shard .
function assertNumMatchingOplogEventsForShard(stats, shardName, expectedTotalReturned) {
    assert(stats.shards.hasOwnProperty(shardName), stats);
    assert.eq(Object.keys(stats.shards[shardName].stages[0])[0], "$cursor", stats);
    const executionStats = stats.shards[shardName].stages[0].$cursor.executionStats;
    assert.eq(executionStats.nReturned, expectedTotalReturned, executionStats);
}
function assertNumMatchingOplogEventsForShard ( stats , shardName , expectedTotalReturned ) { assert ( stats . shards . hasOwnProperty ( shardName ) , stats ) ; assert . eq ( Object . keys ( stats . shards [ shardName ] . stages [ 0 ] ) [ 0 ] , "$cursor" , stats ) ; const executionStats = stats . shards [ shardName ] . stages [ 0 ] . $cursor . executionStats ; assert . eq ( executionStats . nReturned , expectedTotalReturned , executionStats ) ; }
Verifies the number of oplog events read by a particular shard.
Verifies the number of oplog events read by a particular shard .