redis.hset(hash_name, field, value)
redis.hpexpire(hash_name, field, 1000)

assert redis.hpersist(hash_name, field) == [1]

Arguments

key
str
required

The key of the hash.

fields
Union[str, List[str]]
required

The field or list of fields within the hash to remove the expiry from.

Response

A list of integers indicating the result for each field:

  • -2 if the field does not exist in the hash or if the key doesn’t exist.
  • -1 if the field exists but has no associated expiration set.
  • 1 if the expiration was successfully removed.

For more details, see HPERSIST documentation.

redis.hset(hash_name, field, value)
redis.hpexpire(hash_name, field, 1000)

assert redis.hpersist(hash_name, field) == [1]