Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add array val as shorthand for Inclusion

  • Loading branch information...
commit d8db0a47095b3525b4183b1a525b8873002f8aac 1 parent cb49645
mde authored
Showing with 10 additions and 3 deletions.
  1. +10 −3 lib/query/query.js
View
13 lib/query/query.js
@@ -111,9 +111,16 @@ Query.prototype = new (function () {
// Non-null objects
if (val && typeof val == 'object') {
- for (var p in val) {
- type = p;
- val = val[p];
+ // {id: ['foo', 'bar', 'baz']}, shorthand for Inclusion
+ if (Array.isArray(val) {
+ type = 'in';
+ }
+ // {id: {'like': 'foo'}}
+ else {
+ for (var p in val) {
+ type = p;
+ val = val[p];
+ }
}
}
else {
Please sign in to comment.
Something went wrong with that request. Please try again.