Upstash Documentation

HPEXPIRE

Set a timeout on a hash field in milliseconds.
1 min read

Arguments#

keystrrequired#

The key of the hash.

fieldsUnion[str, List[str]]required#

The field or list of fields within the hash to set the expiry for.

millisecondsUnion[int, datetime.timedelta]required#

The timeout in milliseconds as an integer or a datetime.timedelta object.

nxbool#

Set expiry only when the field has no expiry. Defaults to False.

xxbool#

Set expiry only when the field has an existing expiry. Defaults to False.

gtbool#

Set expiry only when the new expiry is greater than the current one. Defaults to False.

ltbool#

Set expiry only when the new expiry is less than the current one. Defaults to False.

Response#