diff --git a/src/database/mongo/sorted.js b/src/database/mongo/sorted.js index 1ac6fb6f85..c1c25eaa75 100644 --- a/src/database/mongo/sorted.js +++ b/src/database/mongo/sorted.js @@ -582,7 +582,7 @@ module.exports = function (db, module) { sortedSetLex(key, min, max, 1, start, count, callback); }; - module.getSortedSetRevRangeByLex = function (key, min, max, start, count, callback) { + module.getSortedSetRevRangeByLex = function (key, max, min, start, count, callback) { sortedSetLex(key, min, max, -1, start, count, callback); }; @@ -599,7 +599,7 @@ module.exports = function (db, module) { count = 0; } - var query = {_key: key, value: {}}; + var query = {_key: key}; if (min !== '-') { if (min.match(/^\(/)) { diff --git a/src/database/redis/sorted.js b/src/database/redis/sorted.js index 0077ab13ec..68d2695d1d 100644 --- a/src/database/redis/sorted.js +++ b/src/database/redis/sorted.js @@ -302,7 +302,9 @@ module.exports = function (redisClient, module) { module.sortedSetRemoveRangeByLex = function (key, min, max, callback) { callback = callback || helpers.noop; - sortedSetLex('zremrangebylex', false, key, min, max, callback); + sortedSetLex('zremrangebylex', false, key, min, max, function (err) { + callback(err); + }); }; module.sortedSetLexCount = function (key, min, max, callback) { diff --git a/test/database/sorted.js b/test/database/sorted.js index af1870ae83..bd944a3825 100644 --- a/test/database/sorted.js +++ b/test/database/sorted.js @@ -19,7 +19,7 @@ describe('Sorted Set methods', function () { db.sortedSetAdd('sortedSetTest3', [2, 4], ['value2', 'value4'], next); }, function (next) { - db.sortedSetAdd('sortedSetLex', [0, 0, 0, 0], ['a', 'b', 'c', 'd'], done); + db.sortedSetAdd('sortedSetLex', [0, 0, 0, 0], ['a', 'b', 'c', 'd'], next); } ], done); });