Save where conds
This commit is contained in:
parent
4e329639cd
commit
13bfb1c972
|
@ -114,7 +114,7 @@ BridgeToRedis.prototype.destroy = function destroy(model, id, callback) {
|
||||||
};
|
};
|
||||||
|
|
||||||
BridgeToRedis.prototype.possibleIndexes = function (model, filter) {
|
BridgeToRedis.prototype.possibleIndexes = function (model, filter) {
|
||||||
if (!filter || Object.keys(filter.where).length === 0) return false;
|
if (!filter || Object.keys(filter.where || {}).length === 0) return false;
|
||||||
|
|
||||||
var foundIndex = [];
|
var foundIndex = [];
|
||||||
Object.keys(filter.where).forEach(function (key) {
|
Object.keys(filter.where).forEach(function (key) {
|
||||||
|
@ -164,7 +164,7 @@ function applyFilter(filter) {
|
||||||
if (typeof filter.where === 'function') {
|
if (typeof filter.where === 'function') {
|
||||||
return filter.where;
|
return filter.where;
|
||||||
}
|
}
|
||||||
var keys = Object.keys(filter.where);
|
var keys = Object.keys(filter.where || {});
|
||||||
return function (obj) {
|
return function (obj) {
|
||||||
var pass = true;
|
var pass = true;
|
||||||
keys.forEach(function (key) {
|
keys.forEach(function (key) {
|
||||||
|
|
Loading…
Reference in New Issue