jstests/noPassthroughWithMongod/lookup_match_pushdown.js
// Checks that the order of the pipeline stages matches the expected ordering.
Checks that the order of the pipeline stages matches the expected ordering.
Checks that the order of the pipeline stages matches the expected ordering .
function checkPipelineAndResults(pipeline, expectedPipeline, expectedResults) {
    const explain = assert.commandWorked(coll.explain().aggregate(pipeline));
    if (expectedPipeline.length > 0) {
        assert.eq(getWinningPlan(explain.stages[0].$cursor.queryPlanner).stage,
                  expectedPipeline[0],
                  explain);
    }
    assert.eq(explain.stages.length, expectedPipeline.length, explain);
    for (let i = 1; i < expectedPipeline.length; i++) {
        assert.eq(Object.keys(explain.stages[i]), expectedPipeline[i], explain);
    }
    const res = coll.aggregate(pipeline).toArray();
    assertArrayEq({actual: res, expected: expectedResults});
}
function checkPipelineAndResults ( pipeline , expectedPipeline , expectedResults ) { const explain = assert . commandWorked ( coll . explain ( ) . aggregate ( pipeline ) ) ; if ( expectedPipeline . length > 0 ) { assert . eq ( getWinningPlan ( explain . stages [ 0 ] . $cursor . queryPlanner ) . stage , expectedPipeline [ 0 ] , explain ) ; } assert . eq ( explain . stages . length , expectedPipeline . length , explain ) ; for ( let i = 1 ; i < expectedPipeline . length ; i ++ ) { assert . eq ( Object . keys ( explain . stages [ i ] ) , expectedPipeline [ i ] , explain ) ; } const res = coll . aggregate ( pipeline ) . toArray ( ) ; assertArrayEq ( { actual : res , expected : expectedResults } ) ; }
Checks that the order of the pipeline stages matches the expected ordering.
Checks that the order of the pipeline stages matches the expected ordering .
// Check pipeline is as expected. // Check results are as expected.