This commit is contained in:
Baris Soner Usakli
2014-01-18 22:23:25 -05:00
parent 8c1c844007
commit 84cbcc5a97
2 changed files with 12 additions and 0 deletions

View File

@@ -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.expireAt(key, Math.round(Date.now() / 1000) + seconds, callback);
}

View File

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