Skip to content

Instantly share code, notes, and snippets.

@olalonde
Created June 14, 2013 19:51
Show Gist options
  • Save olalonde/5784729 to your computer and use it in GitHub Desktop.
Save olalonde/5784729 to your computer and use it in GitHub Desktop.
q = q.where(exp.evaluate({
eql: function (operands) {
var attribute = operands[0],
value = operands[1];
return table[attribute].equal(value);
},
notEql: function (operands) {
var attribute = operands[0],
value = operands[1];
return table[attribute].notEqual(value);
},
or: function (operands) {
var res = operands.shift();
while (operands.length) {
res = res.or(operands.shift());
}
return res;
},
and: function (operands) {
var res = operands.shift();
while (operands.length) {
res = res.and(operands.shift());
}
return res;
}
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment