Comparing version 1.14.4 to 1.14.5
@@ -926,17 +926,21 @@ var util = require(__dirname+'/util.js'); | ||
&& (util.isPlainObject(arguments[0]))) { | ||
var keys = Object.keys(arguments[0]); | ||
if ((keys.length === 1) && (this._getModel()._indexes[keys[0]] === true)) { | ||
query = query.getAll(arguments[0][keys[0]], {index: keys[0]}); | ||
return query; | ||
// Optimize a filter with an object | ||
// We replace the first key that match an index name | ||
var filter = arguments[0]; | ||
var keys = Object.keys(filter).sort(); // Lexicographical order | ||
for(var i=0 ; i<keys.length; i++) { | ||
var index = keys[i]; | ||
if (this._getModel()._indexes[index] === true) { // Index found | ||
query = query.getAll(filter[index], {index: index}); | ||
delete filter[index]; | ||
break; | ||
} | ||
} | ||
else { | ||
query = query[key].apply(query, arguments); | ||
return query; | ||
} | ||
} | ||
else { | ||
query = query[key].apply(query, arguments); | ||
return query; | ||
} | ||
query = query[key].apply(query, arguments); | ||
return query; | ||
} | ||
@@ -943,0 +947,0 @@ break; |
{ | ||
"name": "thinky", | ||
"version": "1.14.4", | ||
"version": "1.14.5", | ||
"description": "RethinkDB ORM for Node.js", | ||
@@ -5,0 +5,0 @@ "main": "lib/thinky.js", |
@@ -117,2 +117,6 @@ # Thinky | ||
- [colprog](https://github.com/colprog) | ||
- [flienteen](https://github.com/flienteen) | ||
- [marshall007](https://github.com/marshall007) | ||
- [Morhaus](https://github.com/Morhaus) | ||
- [nikaspran](https://github.com/nikaspran) | ||
@@ -119,0 +123,0 @@ - [wezs](https://github.com/wezs) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
158998
3466
143