code: function queryCriteriaToMongo(query, options) {
      var hash = {}, p, v, deep
      options = options || {}
  
      for (var key in query) {
          if (Object.prototype.hasOwnProperty.call(query, key) && (!options.ignore || options.ignore.indexOf(key) == -1)) {
              deep = (typeof query[key] === 'object' && !hasOrdinalKeys(query[key]))
  
              if (deep) {
                  p = {
                      key: key,
                      value: queryCriteriaToMongo(query[key])
                  }
              } else {
                  p = comparisonToMongo(key, query[key])
              }
  
              if (p) {
                  if (!hash[p.key]) {
                      hash[p.key] = p.value;
                  } else {
                      hash[p.key] = Object.assign(hash[p.key], p.value);
                  }
              }
          }
      }
      return hash
  }
docs: Convert query parameters to a mongo query criteria. for example {field1:"red","field2>2":""} becomes {field1:"red",field2:{$gt:2}}