mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 03:26:04 +01:00
sortedSetRange tests
This commit is contained in:
@@ -100,6 +100,22 @@ module.exports = function(db, module) {
|
||||
});
|
||||
};
|
||||
|
||||
module.getSortedSetRange = function(key, start, stop, callback) {
|
||||
getSortedSetRange(key, start, stop, 1, false, callback);
|
||||
};
|
||||
|
||||
module.getSortedSetRevRange = function(key, start, stop, callback) {
|
||||
getSortedSetRange(key, start, stop, -1, false, callback);
|
||||
};
|
||||
|
||||
module.getSortedSetRangeWithScores = function(key, start, stop, callback) {
|
||||
getSortedSetRange(key, start, stop, 1, true, callback);
|
||||
};
|
||||
|
||||
module.getSortedSetRevRangeWithScores = function(key, start, stop, callback) {
|
||||
getSortedSetRange(key, start, stop, -1, true, callback);
|
||||
};
|
||||
|
||||
function getSortedSetRange(key, start, stop, sort, withScores, callback) {
|
||||
if (!key) {
|
||||
return callback();
|
||||
@@ -128,22 +144,6 @@ module.exports = function(db, module) {
|
||||
});
|
||||
}
|
||||
|
||||
module.getSortedSetRange = function(key, start, stop, callback) {
|
||||
getSortedSetRange(key, start, stop, 1, false, callback);
|
||||
};
|
||||
|
||||
module.getSortedSetRevRange = function(key, start, stop, callback) {
|
||||
getSortedSetRange(key, start, stop, -1, false, callback);
|
||||
};
|
||||
|
||||
module.getSortedSetRangeWithScores = function(key, start, stop, callback) {
|
||||
getSortedSetRange(key, start, stop, 1, true, callback);
|
||||
};
|
||||
|
||||
module.getSortedSetRevRangeWithScores = function(key, start, stop, callback) {
|
||||
getSortedSetRange(key, start, stop, -1, true, callback);
|
||||
};
|
||||
|
||||
module.getSortedSetRangeByScore = function(key, start, count, min, max, callback) {
|
||||
getSortedSetRangeByScore(key, start, count, min, max, 1, false, callback);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user