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

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/allValCMD.R

Description

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

Usage

1
2
redisTTL(key)
redisPTTL(key)

Arguments

key

The key to look up.

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.

Value

A Redis string value representtion of the integer time left to live or -1 if the key is not set to expire or -2 if not found.

Author(s)

B. W. Lewis

References

http://redis.io/commands

See Also

redisExpire, redisExpireAt

Examples

1
2
3
4
5
6
7
## Not run: 
redisConnect()
redisSet('x',5)
redisExpire('x',100)
redisTTL('x')

## End(Not run)

bwlewis/rredis documentation built on Jan. 3, 2022, 4:53 p.m.