mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 06:55:46 +01:00
organizing redis driver
This commit is contained in:
23
src/database/redis/list.js
Normal file
23
src/database/redis/list.js
Normal file
@@ -0,0 +1,23 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = function(redisClient, module) {
|
||||
module.listPrepend = function(key, value, callback) {
|
||||
redisClient.lpush(key, value, callback);
|
||||
};
|
||||
|
||||
module.listAppend = function(key, value, callback) {
|
||||
redisClient.rpush(key, value, callback);
|
||||
};
|
||||
|
||||
module.listRemoveLast = function(key, callback) {
|
||||
redisClient.rpop(key, callback);
|
||||
};
|
||||
|
||||
module.listRemoveAll = function(key, value, callback) {
|
||||
redisClient.lrem(key, 0, value, callback);
|
||||
};
|
||||
|
||||
module.getListRange = function(key, start, stop, callback) {
|
||||
redisClient.lrange(key, start, stop, callback);
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user