jstests/core/sort_merge.js
// plan and invokes 'callback' to make custom assertions about the SORT_MERGE plan.
plan and invokes 'callback' to make custom assertions about the SORT_MERGE plan.
plan and invokes ' callback ' to make custom assertions about the SORT_MERGE plan .
function verifyPlan(sort, filter, callback) {
    const explain = coll.find(filter).sort(sort.sortPattern).explain("queryPlanner");
    if (FixtureHelpers.isMongos(db)) {
        const sortMergeStages = getPlanStages(explain, "SORT_MERGE");
        for (const sortMerge of sortMergeStages) {
            callback(explain, sortMerge);
        }
    } else {
        const sortMerge = getPlanStage(explain, "SORT_MERGE");
        callback(explain, sortMerge);
    }
}
function verifyPlan ( sort , filter , callback ) { const explain = coll . find ( filter ) . sort ( sort . sortPattern ) . explain ( "queryPlanner" ) ; if ( FixtureHelpers . isMongos ( db ) ) { const sortMergeStages = getPlanStages ( explain , "SORT_MERGE" ) ; for ( const sortMerge of sortMergeStages ) { callback ( explain , sortMerge ) ; } } else { const sortMerge = getPlanStage ( explain , "SORT_MERGE" ) ; callback ( explain , sortMerge ) ; } }
plan and invokes 'callback' to make custom assertions about the SORT_MERGE plan.
plan and invokes ' callback ' to make custom assertions about the SORT_MERGE plan .
// Search for all SORT_MERGE stages in case this is a sharded collection.