Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

PERSIST

Josh Baker edited this page Oct 11, 2016 · 7 revisions

PERSIST key

Remove the existing timeout on key, turning the key from volatile (a key with an expire set) to persistent (a key that will never expire as no timeout is associated).

Return value

Integer reply, specifically:

  • 1 if the timeout was removed.
  • 0 if key does not exist or does not have an associated timeout.

Examples

> SET mykey "Hello"
OK
> EXPIRE mykey 10
(integer) 1
> TTL mykey
(integer) 10
> PERSIST mykey
(integer) 1
> TTL mykey
(integer) -1

Related Commands

APPEND, BITCOUNT, BITOP, BITPOS, DBSIZE, DECR, DECRBY, DEL, EXISTS, EXPIRE, EXPIREAT, FLUSHDB, GET, GETBIT, GETRANGE, GETSET, INCR, INCRBY, INCRBYFLOAT, KEYS, MGET, MSET, MSETNX, PDEL, PERSIST, PEXPIRE, PEXPIREAT, PTTL, RENAME, RENAMENX, SET, SETBIT, SETRANGE, STRLEN, TTL

Clone this wiki locally