Learn R Programming

rredis (version 1.7.0)

redisTTL: Return the time to live for a key set to expire.

Description

She the time left to live in seconds (redisTTL) or milliseconds (redisPTTL) for the specified key.

Usage

redisTTL(key) redisPTTL(key)

Arguments

key
The key to look up.

Value

-2 if not found.

Details

Redis keys may be set to exipre at or after a given time with the redisExpire and redisExpireAt functions. This function shows the time left before exipraton in seconds for such a key.

References

http://redis.io/commands

See Also

redisExpire, redisExpireAt

Examples

Run this code
## Not run: 
# redisConnect()
# redisSet('x',5)
# redisExpire('x',100)
# redisTTL('x')
# ## End(Not run)

Run the code above in your browser using DataLab