jstests/concurrency/fsm_workloads/find_cmd_with_indexes_timeseries.js
/**
         * Query a subset of the time-series collection documents by meta field. This query will
         * either scan the collection or use the meta field index (if present).
         */
Query a subset of the time-series collection documents by meta field. This query will
either scan the collection or use the meta field index (if present).
Query a subset of the time - series collection documents by meta field . This query will either scan the collection or use the meta field index ( if present ) .
function queryMetaSubset(db, collName) {
            const coll = db.getCollection(getCollectionName(collName));
            try {
                const queryDocs = coll.find({[metaIndexKey]: {$gt: 4}}).toArray();
                assertAlways.eq(numDocs / 2,
                                queryDocs.length,
                                "Failed to find " + (numDocs / 2) +
                                    " documents with meta field greater than 4. Query results: " +
                                    tojson(queryDocs));
            } catch (e) {
                assertAlways(e.code == ErrorCodes.QueryPlanKilled,
                             "Expected a QueryPlanKilled error, but encountered: " + e.message);
            }
        }
function queryMetaSubset ( db , collName ) { const coll = db . getCollection ( getCollectionName ( collName ) ) ; try { const queryDocs = coll . find ( { [ metaIndexKey ] : { $gt : 4 } } ) . toArray ( ) ; assertAlways . eq ( numDocs / 2 , queryDocs . length , "Failed to find " + ( numDocs / 2 ) + " documents with meta field greater than 4. Query results: " + tojson ( queryDocs ) ) ; } catch ( e ) { assertAlways ( e . code == ErrorCodes . QueryPlanKilled , "Expected a QueryPlanKilled error, but encountered: " + e . message ) ; } }
Query a subset of the time-series collection documents by meta field.
Query a subset of the time - series collection documents by meta field .
// The query may fail because the index got dropped out from under it.