jstests/libs/analyze_plan.js
/**
 * Given the winning query plan, flatten query plan tree into a list of plan stage names.
 */
Given the winning query plan, flatten query plan tree into a list of plan stage names.
Given the winning query plan flatten query plan tree into a list of plan stage names .
function flattenQueryPlanTree(winningPlan) {
    let stages = [];
    while (winningPlan) {
        stages.push(winningPlan.stage);
        winningPlan = winningPlan.inputStage;
    }
    stages.reverse();
    return stages;
}
function flattenQueryPlanTree ( winningPlan ) { let stages = [ ] ; while ( winningPlan ) { stages . push ( winningPlan . stage ) ; winningPlan = winningPlan . inputStage ; } stages . reverse ( ) ; return stages ; }
Given the winning query plan, flatten query plan tree into a list of plan stage names.
Given the winning query plan flatten query plan tree into a list of plan stage names .