The HGETEX command returns the values of the specified fields and optionally sets their expiration time or TTL. This allows you to retrieve hash data while managing its lifetime in a single operation.
Arguments#
The key of the hash.
Expiration options for the hash fields. The options are mutually exclusive - you can only use one at a time.
Show propertiesHide properties
Set expiration time in seconds. Cannot be used with other expiration options.
Set expiration time in milliseconds. Cannot be used with other expiration options.
Set expiration as Unix timestamp in seconds. Cannot be used with other expiration options.
Set expiration as Unix timestamp in milliseconds. Cannot be used with other expiration options.
Remove expiration from the hash. Must be set to true. Cannot be used with other expiration options.
One or more field names to get.
Response#
Use Cases#
- Session Management: Retrieve session data and extend its lifetime
- Cache Refresh: Get cached data and update its TTL
- Temporary Data: Access temporary data while managing its expiration
- Rate Limiting: Fetch rate limit data and reset expiration