PEXPIRE key milliseconds
This command works exactly like EXPIRE but the time to live of the key is specified in milliseconds instead of seconds.
TIME COMPLEXITY O(1)
RETURN VALUE integer reply, specifically:
1 if the timeout was set.
0 if the key does not exist or the timeout could not be set.
Syntax:
PEXPIRE key milliseconds
Example 1: When the key is present.
redis:6379> PEXPIRE redisKey1 1000(integer) 1
Output
1
Example 2: When the key is not present.
redis:6379> PEXPIRE redisKey 1000(integer) 0
Output
0
No comments:
Post a Comment