set expire time but How to get key expire time ?




var options = {
'port': 6379,
'host': '127.0.0.1',
'password': 'root',
'db': 0,
'ttl': 10000000
}

var redis = require("redis"),
client=redis.createClient(options);


client.set('outTime', 'value!', 'EX', 100000);

client.get("outTime", function(err, reply,) {
// reply is null when the key is missing
console.log(reply)
})

client.ttl('outTime', (err, ttl) => {
console.log(ttl)
})


 

发表评论

邮箱地址不会被公开。 必填项已用*标注