PSETEX

Apply for Redis Developer Course Redis Regular Inspection / Technical Support Redis Enterprise Server

The data is deleted after the specified time: in milliseconds

The data is deleted after the specified milliseconds.
Use this when you need a finer-grained expire time.

Example

Command>psetex key 10000 value
Result>OK
Command>pttl key
Result>5687   remaining time in milliseconds
Command>get key
Result>value
Command>get key
Result>(nil)   the data was deleted after 10000 milliseconds
PTTL reports the remaining time in milliseconds.


Syntax

PSETEX key milliseconds value

  • Available since version 2.6.0.
  • Time complexity is O(1).
Related commands SET, SETEX, PTTL, EXISTS
Clients for Java Jedis, Lettuce, Redisson
Clients for C Hiredis

<< SETEX PSETEX MSET >>

Email 답글이 올라오면 이메일로 알려드리겠습니다.