jstests/core/wildcard_index_hint.js
// (2) the results produced by the index match the given 'expectedResults'.
(2) the results produced by the index match the given 'expectedResults'.
( 2 ) the results produced by the index match the given ' expectedResults ' .
function assertExpectedIndexAnswersQueryWithHint(query, hint, expectedIndexName, expectedResults) {
    const ixScans = getPlanStages(winningPlan(query, hint), "IXSCAN");
    assert.gt(ixScans.length, 0, tojson(coll.find(query).hint(hint).explain()));
    ixScans.forEach((ixScan) => assert.eq(ixScan.indexName, expectedIndexName));
    const wildcardResults = coll.find(query, {_id: 0}).hint(hint).toArray();
    assertArrayEq(wildcardResults, expectedResults);
}
function assertExpectedIndexAnswersQueryWithHint ( query , hint , expectedIndexName , expectedResults ) { const ixScans = getPlanStages ( winningPlan ( query , hint ) , "IXSCAN" ) ; assert . gt ( ixScans . length , 0 , tojson ( coll . find ( query ) . hint ( hint ) . explain ( ) ) ) ; ixScans . forEach ( ( ixScan ) => assert . eq ( ixScan . indexName , expectedIndexName ) ) ; const wildcardResults = coll . find ( query , { _id : 0 } ) . hint ( hint ) . toArray ( ) ; assertArrayEq ( wildcardResults , expectedResults ) ; }
(2) the results produced by the index match the given 'expectedResults'.
( 2 ) the results produced by the index match the given ' expectedResults ' .