PERSIST

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

Remove expire time

Usage is persist key [type].
📍 type is one of string/list/set/zset/hash/stream.
      type was added from ent811. Please use it.

Example

Command>set key value
Result>1
Command>expire key 5 string
Result>1
Command>ttl key string
Result>3
Command>persist key string
Result>1
Command>ttl key string
Result>-1
Command>get key
Result>value

View animation


Syntax

PERSIST key [type]

  • Available since version 2.2.0.
  • Time complexity is O(1).
  • From 6.0, Event Notification is generated -> 'persist'
  • ent811 type added.
Related commands SMEMBERS, TTL, PERSIST, PSETEX, EXPIREAT, PEXPIRE, PEXPIREAT, PTTL
Clients for Java Jedis, Lettuce, Redisson
Clients for C Hiredis

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