jstests/core/timeseries/timeseries_predicates_with_projections.js
// by comparing the result on a time-series collection against a normal collection.
by comparing the result on a time-series collection against a normal collection.
by comparing the result on a time - series collection against a normal collection .
function checkPredicateResult(projection, predicate, documents) {
    for (const doc of documents) {
        doc._id = ObjectId();
        doc.time = ISODate();
    }
    assert.commandWorked(coll.deleteMany({}));
    bucketsColl.deleteMany({});
    assert.commandWorked(coll.insert(documents));
    assert.commandWorked(tsColl.insert(documents));
    const normalResult = coll.aggregate([{$project: projection}, {$match: predicate}]).toArray();
    const tsResult = tsColl.aggregate([{$project: projection}, {$match: predicate}]).toArray();
    jsTest.log(normalResult, tsResult);
    assert.sameMembers(normalResult, tsResult);
}
function checkPredicateResult ( projection , predicate , documents ) { for ( const doc of documents ) { doc . _id = ObjectId ( ) ; doc . time = ISODate ( ) ; } assert . commandWorked ( coll . deleteMany ( { } ) ) ; bucketsColl . deleteMany ( { } ) ; assert . commandWorked ( coll . insert ( documents ) ) ; assert . commandWorked ( tsColl . insert ( documents ) ) ; const normalResult = coll . aggregate ( [ { $project : projection } , { $match : predicate } ] ) . toArray ( ) ; const tsResult = tsColl . aggregate ( [ { $project : projection } , { $match : predicate } ] ) . toArray ( ) ; jsTest . log ( normalResult , tsResult ) ; assert . sameMembers ( normalResult , tsResult ) ; }
by comparing the result on a time-series collection against a normal collection.
by comparing the result on a time - series collection against a normal collection .