jstests/core/explain_plan_scores.js
// Scores should only be outputted alongside each plan's trial stats in 'allPlansExecution'.
Scores should only be outputted alongside each plan's trial stats in 'allPlansExecution'.
Scores should only be outputted alongside each plan ' s trial stats in ' allPlansExecution ' .
function checkExplainOutput(explain, verbosity) {
    const winningPlan = getWinningPlan(explain.queryPlanner);
    assert(!winningPlan.hasOwnProperty("score"), explain);
    const rejectedPlans = getRejectedPlans(explain);
    for (let rejectedPlan of rejectedPlans) {
        rejectedPlan = getRejectedPlan(rejectedPlan);
        assert(!rejectedPlan.hasOwnProperty("score"), explain);
    }
    if (verbosity != "queryPlanner") {
        assert(!explain.executionStats.hasOwnProperty("score"), explain);
    }
    if (verbosity == "allPlansExecution") {
        const allPlans = explain.executionStats.allPlansExecution;
        for (let plan of allPlans) {
            assert(plan.hasOwnProperty("score"), explain);
            assert.gt(plan.score, 0, explain);
        }
    }
}
function checkExplainOutput ( explain , verbosity ) { const winningPlan = getWinningPlan ( explain . queryPlanner ) ; assert ( ! winningPlan . hasOwnProperty ( "score" ) , explain ) ; const rejectedPlans = getRejectedPlans ( explain ) ; for ( let rejectedPlan of rejectedPlans ) { rejectedPlan = getRejectedPlan ( rejectedPlan ) ; assert ( ! rejectedPlan . hasOwnProperty ( "score" ) , explain ) ; } if ( verbosity != "queryPlanner" ) { assert ( ! explain . executionStats . hasOwnProperty ( "score" ) , explain ) ; } if ( verbosity == "allPlansExecution" ) { const allPlans = explain . executionStats . allPlansExecution ; for ( let plan of allPlans ) { assert ( plan . hasOwnProperty ( "score" ) , explain ) ; assert . gt ( plan . score , 0 , explain ) ; } } }
Scores should only be outputted alongside each plan's trial stats in 'allPlansExecution'.
Scores should only be outputted alongside each plan ' s trial stats in ' allPlansExecution ' .