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