upgrade tags to sorted set

This commit is contained in:
barisusakli
2014-05-22 13:06:19 -04:00
parent 853acaa6c7
commit 746df87d89
7 changed files with 105 additions and 47 deletions

View File

@@ -5,7 +5,7 @@ var async = require('async');
module.exports = function(db, module) {
var helpers = module.helpers.level;
module.sortedSetAdd = function(key, score, value, callback) {
module.getListRange(key, 0, -1, function(err, set) {
set = set.filter(function(a) {return a.value !== value.toString();});
@@ -57,6 +57,10 @@ module.exports = function(db, module) {
});
};
module.getSortedSetRevRangeWithScores = function(key, start, stop, callback) {
// should return [{value:"test", score: 2}, {value: "foo", score: 1}, ...]
};
module.getSortedSetRangeByScore = function(key, start, count, min, max, callback) {
module.getListRange(key, 0, -1, function(err, list) {
if (min && max) {