jstests/core/timeseries/timeseries_index_partial.js
// Verify that the index is used when possible.
Verify that the index is used when possible.
Verify that the index is used when possible .
function checkPlanAndResult({predicate, collation, stageName, indexName, expectedResults}) {
        let cur = coll.find(predicate, {_id: 0, a: 1});
        if (collation) {
            cur.collation(collation);
        }
        const plan = cur.explain();
        const stage = getAggPlanStage(plan, stageName);
        assert(stage, "Expected a " + stageName + " stage: " + tojson(plan));
        if (indexName) {
            assert.eq(stage.indexName, indexName, stage);
        }
        const results = cur.toArray();
        assert.docEq(results, expectedResults);
    }
function checkPlanAndResult ( { predicate , collation , stageName , indexName , expectedResults } ) { let cur = coll . find ( predicate , { _id : 0 , a : 1 } ) ; if ( collation ) { cur . collation ( collation ) ; } const plan = cur . explain ( ) ; const stage = getAggPlanStage ( plan , stageName ) ; assert ( stage , "Expected a " + stageName + " stage: " + tojson ( plan ) ) ; if ( indexName ) { assert . eq ( stage . indexName , indexName , stage ) ; } const results = cur . toArray ( ) ; assert . docEq ( results , expectedResults ) ; }
Verify that the index is used when possible.
Verify that the index is used when possible .