Arguments
str
required
The key of the hash.
Union[str, List[str]]
required
The field or list of fields to set an expiration time for.
int
required
The expiration time as a Unix timestamp in milliseconds.
bool
Set expiry only when the field has no expiry. Defaults to
False.bool
Set expiry only when the field has an existing expiry. Defaults to
False.bool
Set expiry only when the new expiry is greater than the current one. Defaults to
False.bool
Set expiry only when the new expiry is less than the current one. Defaults to
False.Response
A list of integers indicating whether the expiry was successfully set.
-2if the field does not exist in the hash or if the key doesn’t exist.0if the expiration was not set due to the condition.1if the expiration was successfully set.2if called with 0 seconds/milliseconds or a past Unix time.