jstests/change_streams/oplog_rewrite/change_stream_null_existence_eq_rewrite_test.js
// Define the filters that we want to apply to each field.
Define the filters that we want to apply to each field.
Define the filters that we want to apply to each field .
function generateMatchFilters(fieldPath) {
    const valuesToTest =
        fieldsToBeTested[fieldPath].values.concat(fieldsToBeTested[fieldPath].extraValues);
    const filters = [
        {[fieldPath]: {$eq: null}},
        {[fieldPath]: {$ne: null}},
        {[fieldPath]: {$lte: null}},
        {[fieldPath]: {$gte: null}},
        {[fieldPath]: {$exists: true}},
        {[fieldPath]: {$exists: false}}
    ];
    for (let value of valuesToTest) {
        filters.push({[fieldPath]: value});
    }
    return filters;
}
function generateMatchFilters ( fieldPath ) { const valuesToTest = fieldsToBeTested [ fieldPath ] . values . concat ( fieldsToBeTested [ fieldPath ] . extraValues ) ; const filters = [ { [ fieldPath ] : { $eq : null } } , { [ fieldPath ] : { $ne : null } } , { [ fieldPath ] : { $lte : null } } , { [ fieldPath ] : { $gte : null } } , { [ fieldPath ] : { $exists : true } } , { [ fieldPath ] : { $exists : false } } ] ; for ( let value of valuesToTest ) { filters . push ( { [ fieldPath ] : value } ) ; } return filters ; }
Define the filters that we want to apply to each field.
Define the filters that we want to apply to each field .