docs: function matchesCriteria(data, criteria) {
          data = data || {};
          criteria = criteria || {};
  
          var match = true;
          _.each(criteria, function (val, key) {
              var hasNotOperand = false;
  
              if (_.isObject(val) && val['$ne'] ) {
                  hasNotOperand = true;
                  val = val['$ne'];
              }
              var dataValue = getNestedValue(data, key);
              if (_.isString(val) && _.isArray(dataValue)) { // allows you to check if an array contains a value
                  match = (dataValue.indexOf(val) > -1);
              }
              else {
                  var vals = _.isArray(val) ? val : [val];
                  if (vals.indexOf(dataValue) < 0) {
                      match = false;
                  }
                  if ( hasNotOperand ) {
                      match = !match;
                  }
              }
          });
  
          return match;
      }