Sets both string value and expiration time in milliseconds of a key. The key is created if it doesn’t exist.
PSETEX key
milliseconds value
PSETEX works exactly like SETEX with the
sole difference that the expire time is specified in milliseconds
instead of seconds.
SET with the PX argument.
Simple string
reply: OK.
O(1)
@slow @string @write
127.0.0.1:6379> PSETEX mykey 1000 "Hello"
OK
127.0.0.1:6379> PTTL mykey
(integer) 990
127.0.0.1:6379> GET mykey
"Hello"
APPEND, DECR, DECRBY, DELIFEQ, GET, GETDEL, GETEX, GETRANGE, GETSET, INCR, INCRBY, INCRBYFLOAT, LCS, MGET, MSET, MSETNX, SET, SETEX, SETNX, SETRANGE, STRLEN, SUBSTR.