Save where conds

This commit is contained in:
Anatoliy Chakkaev 2011-11-14 15:46:48 +07:00
parent 4e329639cd
commit 13bfb1c972
1 changed files with 2 additions and 2 deletions

View File

@ -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) {