Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

find by id has some problem when key does not exist #10

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/redis.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Module dependencies
*/
var redis = require('redis');

var _=require('lodash');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary dependency. Use Array.prototype.filter

exports.initialize = function initializeSchema(schema, callback) {
if (!redis) return;

Expand Down Expand Up @@ -548,7 +548,7 @@ BridgeToRedis.prototype.all = function all(model, filter, callback) {
if (err) {
return callback(err);
}

replies=_.filter(replies, function(value) { return value !== null; });
var objs = (replies || []).map(function (r) {
return redis.fromDb(model, r);
});
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jugglingdb-redis",
"version": "0.0.2-2",
"version": "0.0.2-3",
"description": "Redis adapter for jugglingdb",
"main": "index.js",
"author": "Anatoliy Chakkaev <[email protected]>",
Expand All @@ -18,7 +18,8 @@
"test": "make test"
},
"dependencies": {
"redis": "= 0.7.2"
"redis": "= 0.7.2",
"lodash": "^2.4.1"
},
"devDependencies": {
"jugglingdb": "https://github.com/1602/jugglingdb/archive/master.tar.gz",
Expand Down