Latest web development tutorials

Redis Psetex command

Redis string (string)

Redis Psetex command set in milliseconds key survival time.

grammar

redis Psetex basic command syntax is as follows:

redis 127.0.0.1:6379> PSETEX key1 EXPIRY_IN_MILLISECONDS value1 

Available versions

> = 2.6.0

return value

Back OK when setting success.

Examples

redis 127.0.0.1:6379> PSETEX mykey 1000 "Hello"
OK
redis 127.0.0.1:6379> PTTL mykey
999
redis 127.0.0.1:6379> GET mykey
1) "Hello"

Redis string (string)