From 13bfb1c97277ff88acc1c12ee4695fd3dc56e425 Mon Sep 17 00:00:00 2001 From: Anatoliy Chakkaev Date: Mon, 14 Nov 2011 15:46:48 +0700 Subject: [PATCH] Save where conds --- lib/adapters/redis.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/adapters/redis.js b/lib/adapters/redis.js index d2a170a3..08aa05b7 100644 --- a/lib/adapters/redis.js +++ b/lib/adapters/redis.js @@ -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) {