Skip to main content
Use HPERSIST to remove the expiration from hash fields so that they stop being deleted automatically. The reply holds one status code per requested field, in order: 1 when an expiration was removed, -1 when the field exists but had no expiration, and -2 when the field or the key does not exist. This is how a field set by HEXPIRE or HSETEX is promoted from temporary to permanent without rewriting its value. FIELDS <numfields> introduces the field list and the count must match.

Syntax

Arguments

Response

The reply reports the result of the operation. Error replies have the same shape in RESP2 and RESP3 and are surfaced as exceptions by the SDKs below.
Client libraries often decode bulk strings, maps, sets, and numeric strings into language-native values. The table describes the Redis wire reply.

Examples

TCP examples use the TLS REDIS_URL from the Upstash console. REST examples use UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN.