docs: function (item, expression) {
              var ret = 1,
                  operator = expression.operator;
  
              if (expression instanceof Query.Where) {
                  if (operator === "or") {
                      ret = 0;
                  }
                  var tmp;
                  for (var i = 0; i < expression.expressions.length; i++) {
                      tmp = this._filterItem(item, expression.expressions[i]);
                      if (operator === "and") {
                          ret = ret * tmp;
                      } else if (operator === "or" && tmp) {
                          return 1;
                      } else if (operator === "not") {
                          return tmp ? 0 : 1;
                      }
                  }
              } else if (expression instanceof Query.Comparator) {
                  // TODO: add type check
                  var value = expression.value,
                      field = expression.field,
                      itemValue = this._getValueForItemField(item, field);
  
                  if (typeof(itemValue) === "undefined") {
                      return 0;
                  }
  
                  switch (operator) {
                      case "eql":
                          return itemValue == value;
                      case "gt":
                          return itemValue > value;
                      case "lt":
                          return itemValue < value;
                      case "gte":
                          return itemValue >= value;
                      case "lte":
                          return itemValue <= value;
                      case "in":
                          if (!(itemValue instanceof Array)) {
                              itemValue = [itemValue];
                          }
                          for (var j = 0; j < itemValue.length; j++) {
                              for (var k in value) {
                                  if (value.hasOwnProperty(k)) {
                                      if (itemValue[j] == value[k]) {
                                          return 1;
                                      }
                                  }
                              }
                          }
                          return 0;
                      case "between":
                          return itemValue >= value[0] && itemValue <= value[1];
                      case "like":
                          return new RegExp(value, "i").test(itemValue);
                      case "ne":
                          return itemValue != value;
                      default :
                          return 1;
                  }
  
              }
  
              return ret;
          }