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) {
|
||||
if (!filter || Object.keys(filter.where).length === 0) return false;
|
||||
if (!filter || Object.keys(filter.where || {}).length === 0) return false;
|
||||
|
||||
var foundIndex = [];
|
||||
Object.keys(filter.where).forEach(function (key) {
|
||||
|
@ -164,7 +164,7 @@ function applyFilter(filter) {
|
|||
if (typeof filter.where === 'function') {
|
||||
return filter.where;
|
||||
}
|
||||
var keys = Object.keys(filter.where);
|
||||
var keys = Object.keys(filter.where || {});
|
||||
return function (obj) {
|
||||
var pass = true;
|
||||
keys.forEach(function (key) {
|
||||
|
|
Loading…
Reference in New Issue