jstests/noPassthroughWithMongod/index_bounds_static_limit.js
/**
 * Takes and output of explain("executionStats") command and verifieies whether generic or optimized
 * index scan plan used.
 * @param {*} explain - output of explain("executionStats") command.
 * @param {*} isGeneric - true if generic plan expected and false if an optimized plan expected.
 */
Takes and output of explain("executionStats") command and verifieies whether generic or optimized
index scan plan used.
@param {*} explain - output of explain("executionStats") command.
@param {*} isGeneric - true if generic plan expected and false if an optimized plan expected.
Takes and output of explain ( " executionStats " ) command and verifieies whether generic or optimized index scan plan used . @param { * } explain - output of explain ( " executionStats " ) command . @param { * } isGeneric - true if generic plan expected and false if an optimized plan expected .
function assertIndexScanPlan(explain, isGeneric) {
    const stages = explain.executionStats.executionStages;
    const branchStage = getPlanStage(stages, "branch");
    const filterSlot = branchStage.filter.trim();
    const isGenericSlotValue = `${filterSlot} = ${isGeneric}`;
    const slotValues = explain.queryPlanner.winningPlan.slotBasedPlan.slots;
    assert(slotValues.search(isGenericSlotValue) != -1, explain);
    const ixseekStages = getPlanStages(stages, "ixseek");
    assert.neq(0, ixseekStages.length, explain);
}
function assertIndexScanPlan ( explain , isGeneric ) { const stages = explain . executionStats . executionStages ; const branchStage = getPlanStage ( stages , "branch" ) ; const filterSlot = branchStage . filter . trim ( ) ; const isGenericSlotValue = ` ${ filterSlot } ${ isGeneric } ` ; const slotValues = explain . queryPlanner . winningPlan . slotBasedPlan . slots ; assert ( slotValues . search ( isGenericSlotValue ) != - 1 , explain ) ; const ixseekStages = getPlanStages ( stages , "ixseek" ) ; assert . neq ( 0 , ixseekStages . length , explain ) ; }
Takes and output of explain("executionStats") command and verifieies whether generic or optimized
 index scan plan used.
Takes and output of explain ( " executionStats " ) command and verifieies whether generic or optimized index scan plan used .
// Asserts whether this plan is generic or optimized. // Asserts that this plan contains ixseek stage.