jstests/noPassthrough/lookup_with_limit_sharded.js
// ordering for an unsharded collection.
ordering for an unsharded collection.
ordering for an unsharded collection .
function checkUnshardedResults(pipeline, expectedPlanStages, expectedPipeline) {
    const explain = coll.explain().aggregate(pipeline);
    if (explain.stages) {
        const queryStages =
            flattenQueryPlanTree(getWinningPlan(explain.stages[0].$cursor.queryPlanner));
        const pipelineStages = explain.stages.slice(1).map(s => Object.keys(s)[0]);
        assert.eq(queryStages, expectedPlanStages, explain);
        assert.eq(pipelineStages, expectedPipeline, explain);
    } else {
        const queryStages = flattenQueryPlanTree(getWinningPlan(explain.queryPlanner));
        assert.eq(queryStages, expectedPlanStages, explain);
        assert.eq([], expectedPipeline, explain);
    }
}
function checkUnshardedResults ( pipeline , expectedPlanStages , expectedPipeline ) { const explain = coll . explain ( ) . aggregate ( pipeline ) ; if ( explain . stages ) { const queryStages = flattenQueryPlanTree ( getWinningPlan ( explain . stages [ 0 ] . $cursor . queryPlanner ) ) ; const pipelineStages = explain . stages . slice ( 1 ) . map ( s => Object . keys ( s ) [ 0 ] ) ; assert . eq ( queryStages , expectedPlanStages , explain ) ; assert . eq ( pipelineStages , expectedPipeline , explain ) ; } else { const queryStages = flattenQueryPlanTree ( getWinningPlan ( explain . queryPlanner ) ) ; assert . eq ( queryStages , expectedPlanStages , explain ) ; assert . eq ( [ ] , expectedPipeline , explain ) ; } }
ordering for an unsharded collection.
ordering for an unsharded collection .