{"acl_categories":["@keyspace","@write","@fast"],"arguments":[{"display_text":"key","key_spec_index":0,"name":"key","type":"key"}],"arity":2,"categories":["docs","develop","stack","oss","rs","rc","oss","kubernetes","clients"],"command_flags":["write","fast"],"complexity":"O(1)","description":"Removes the expiration time of a key.","duplicateOf":"head:data-ai-metadata","group":"generic","key_specs":[{"RW":true,"begin_search":{"spec":{"index":1},"type":"index"},"find_keys":{"spec":{"keystep":1,"lastkey":0,"limit":0},"type":"range"},"update":true}],"location":"body","since":"2.2.0","syntax_fmt":"PERSIST key","title":"PERSIST","tableOfContents":{"sections":[{"id":"examples","title":"Examples"},{"id":"redis-software-and-redis-cloud-compatibility","title":"Redis Software and Redis Cloud compatibility"},{"id":"return-information","title":"Return information"}]},"codeExamples":[]}
persist(
key: byte[]
) → long// 1 if the timeout was removed, 0 if key does not exist or does not have an associated timeoutpersist(
key: String
) → long// 1 if the timeout was removed, 0 if key does not exist or does not have an associated timeout
persist(
key: K// the key.
) → Boolean// Boolean integer-reply specifically: true if the timeout was removed. false if key does not exist or does not have an associated timeout.
persist(
key: K// the key.
) → RedisFuture<Boolean>// Boolean integer-reply specifically: true if the timeout was removed. false if key does not exist or does not have an associated timeout.
persist(
key: K// the key.
) → Mono<Boolean>// Boolean integer-reply specifically: true if the timeout was removed. false if key does not exist or does not have an associated timeout.
KeyPersist(
key: RedisKey, // The key to persist.flags: CommandFlags// The flags to use for this operation.
) → bool// true if the timeout was removed. false if key does not exist or does not have an associated timeout.
KeyPersistAsync(
key: RedisKey, // The key to persist.flags: CommandFlags// The flags to use for this operation.
) → Task<bool>// true if the timeout was removed. false if key does not exist or does not have an associated timeout.
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).
Examples
Redis Software and Redis Cloud compatibility
Redis Software
Redis Cloud
Notes
✅ Standard ✅ Active-Active
✅ Standard ✅ Active-Active
Return information
One of the following:
Integer reply: 0 if key does not exist or does not have an associated timeout.