v1.18.x
Baris Soner Usakli 11 years ago
parent 8c1c844007
commit 84cbcc5a97

@ -230,6 +230,14 @@
}); });
} }
module.rename = function(oldKey, newKey, callback) {
db.collection('objects').update({_key: oldKey}, {$set:{_key: newKey}}, function(err, result) {
if(callback) {
callback(err, result);
}
});
}
module.expire = function(key, seconds, callback) { module.expire = function(key, seconds, callback) {
module.expireAt(key, Math.round(Date.now() / 1000) + seconds, callback); module.expireAt(key, Math.round(Date.now() / 1000) + seconds, callback);
} }

@ -206,6 +206,10 @@
redisClient.keys(key, callback); redisClient.keys(key, callback);
} }
module.rename = function(oldKey, newKey, callback) {
redisClient.rename(oldKey, newKey, callback);
}
module.expire = function(key, seconds, callback) { module.expire = function(key, seconds, callback) {
redisClient.expire(key, seconds, callback); redisClient.expire(key, seconds, callback);
} }

Loading…
Cancel
Save