mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-31 19:15:58 +01:00
sortedSetsRemove
instead of calling sortedSetRemove() one at a time for each id remove value from multiple sortedSets with one db call
This commit is contained in:
@@ -9,6 +9,16 @@ module.exports = function(redisClient, module) {
|
||||
redisClient.zrem(key, value, callback);
|
||||
};
|
||||
|
||||
module.sortedSetsRemove = function(keys, value, callback) {
|
||||
var multi = redisClient.multi();
|
||||
|
||||
for(var x=0; x<keys.length; ++x) {
|
||||
multi.zrem(keys[x], value);
|
||||
}
|
||||
|
||||
multi.exec(callback);
|
||||
};
|
||||
|
||||
module.getSortedSetRange = function(key, start, stop, callback) {
|
||||
redisClient.zrange(key, start, stop, callback);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user