added pexpire and pexpireAt methods for redis and mongo. Added emoticons for leveldb (as per existing implementation by @psychobunny LOL)

This commit is contained in:
Julian Lam
2014-05-11 10:31:32 -04:00
parent 4e0ccbf0c6
commit bab140c396
3 changed files with 24 additions and 0 deletions

View File

@@ -90,4 +90,12 @@ module.exports = function(db, module) {
module.expireAt = function(key, timestamp, callback) {
module.setObjectField(key, 'expireAt', new Date(timestamp * 1000), callback);
};
module.pexpire = function(key, ms, callback) {
module.expireAt(key, Date.now() + parseInt(ms, 10), callback);
};
module.pexpireAt = function(key, timestamp, callback) {
module.setObjectField(key, 'expireAt', new Date(timestamp), callback);
};
};