jstests/concurrency/fsm_workloads/insert_ttl_timeseries.js
/**
         * Insert a batch for the current thread id but with older times that should be inserted in
         * different buckets.
         */
Insert a batch for the current thread id but with older times that should be inserted in
different buckets.
Insert a batch for the current thread id but with older times that should be inserted in different buckets .
function insertManyOld(db, collName) {
            const coll = this.getCollection(db, collName);
            const docs = [];
            const start = getTime();
            for (let i = 0; i < batchSize; i++) {
                let time = new Date(start.getTime() - ((batchSize - i) * defaultBucketMaxRangeMs));
                docs.push({
                    [metaFieldName]: this.tid,
                    [timeFieldName]: time,
                    data: Random.rand(),
                });
            }
            const res = coll.insertMany(docs, {ordered: false});
            assertAlways.commandWorked(res);
            assertAlways.eq(res.insertedIds.length, batchSize);
        }
function insertManyOld ( db , collName ) { const coll = this . getCollection ( db , collName ) ; const docs = [ ] ; const start = getTime ( ) ; for ( let i = 0 ; i < batchSize ; i ++ ) { let time = new Date ( start . getTime ( ) - ( ( batchSize - i ) * defaultBucketMaxRangeMs ) ) ; docs . push ( { [ metaFieldName ] : this . tid , [ timeFieldName ] : time , data : Random . rand ( ) , } ) ; } const res = coll . insertMany ( docs , { ordered : false } ) ; assertAlways . commandWorked ( res ) ; assertAlways . eq ( res . insertedIds . length , batchSize ) ; }
Insert a batch for the current thread id but with older times that should be inserted in
 different buckets.
Insert a batch for the current thread id but with older times that should be inserted in different buckets .