jstests/core/nan.js
/**
 * Ensures that documents with NaN values do not get matched when the query has a non-NaN value.
 */
Ensures that documents with NaN values do not get matched when the query has a non-NaN value.
Ensures that documents with NaN values do not get matched when the query has a non - NaN value .
function testNonNaNQuery() {
    const queries = [{a: 1}, {a: {$lt: 1}}, {a: {$lte: 1}}, {a: {$gt: 1}}, {a: {$gte: 1}}];
    for (const query of queries) {
        const cursor = coll.find(query);
        assert(!cursor.hasNext());
    }
}
function testNonNaNQuery ( ) { const queries = [ { a : 1 } , { a : { $lt : 1 } } , { a : { $lte : 1 } } , { a : { $gt : 1 } } , { a : { $gte : 1 } } ] ; for ( const query of queries ) { const cursor = coll . find ( query ) ; assert ( ! cursor . hasNext ( ) ) ; } }
Ensures that documents with NaN values do not get matched when the query has a non-NaN value.
Ensures that documents with NaN values do not get matched when the query has a non - NaN value .