src/parse-mockdb.js
function queryFilter(where) {
  if (where.$or) {
    return object =>
      _.reduce(where.$or, (result, subclause) => result ||
        queryFilter(subclause)(object), false);
  }

  // Go through each key in where clause
  return object => _.reduce(where, (result, whereParams, key) => {
    const match = evaluateObject(object, whereParams, key);
    return result && match;
  }, true);
}
function queryFilter(where) {
  if (where.$or) {
    return object =>
      _.reduce(where.$or, (result, subclause) => result ||
        queryFilter(subclause)(object), false);
  }

  // Go through each key in where clause
  return object => _.reduce(where, (result, whereParams, key) => {
    const match = evaluateObject(object, whereParams, key);
    return result && match;
  }, true);
}
function queryFilter ( where ) { if ( where . $or ) { return object => _ . reduce ( where . $or , ( result , subclause ) => result || queryFilter ( subclause ) ( object ) , false ) ; } // Go through each key in where clause return object => _ . reduce ( where , ( result , whereParams , key ) => { const match = evaluateObject ( object , whereParams , key ) ; return result && match ; } , true ) ; }
Returns a function that filters query matches on a where clause
Returns a function that filters query matches on a where clause