ability to send an array of keys to getSortedSetRange
use getSortedSetRevRange instead of getSortedSetRevUnion
This commit is contained in:
barisusakli
2016-03-03 19:52:48 +02:00
parent b2b104dab3
commit 018f7ba65a
4 changed files with 55 additions and 31 deletions

View File

@@ -125,6 +125,11 @@ module.exports = function(db, module) {
if (withScores) {
fields.score = 1;
}
if (Array.isArray(key)) {
key = {$in: key};
}
db.collection('objects').find({_key: key}, {fields: fields})
.limit(stop - start + 1)
.skip(start)
@@ -459,6 +464,7 @@ module.exports = function(db, module) {
getSortedSetUnion(sets, -1, start, stop, callback);
};
function getSortedSetUnion(sets, sort, start, stop, callback) {
if (!Array.isArray(sets) || !sets.length) {
return callback();