diff --git a/content/develop/data-types/hashes.md b/content/develop/data-types/hashes.md index 3f109ae6a..0a684db95 100644 --- a/content/develop/data-types/hashes.md +++ b/content/develop/data-types/hashes.md @@ -100,7 +100,7 @@ See the [complete list of hash commands]({{< relref "/commands/" >}}?group=hash) ## Field expiration -New in Redis Open Source 7.4 is the ability to specify an expiration time or a time-to-live (TTL) value for individual hash fields. +Redis 7.4 introduced the ability to specify an expiration time or a time-to-live (TTL) value for individual hash fields. This capability is comparable to [key expiration]({{< relref "/develop/using-commands/keyspace#key-expiration" >}}) and includes a number of similar commands. Use the following commands to set either an exact expiration time or a TTL value for specific fields: @@ -123,6 +123,11 @@ Use the following command to remove the expiration of specific fields: * [`HPERSIST`]({{< relref "/commands/hpersist" >}}): remove the expiration. +Redis 8.0 introduced the following commands: + +* [`HGETEX`]({{< relref "/commands/HGETEX" >}}): Get the value of one or more fields of a given hash key and optionally set their expiration time or time-to-live (TTL). +* [`HSETEX`]({{< relref "/commands/HSETEX" >}}): Set the value of one or more fields of a given hash key and optionally set their expiration time or time-to-live (TTL). + ### Common field expiration use cases 1. **Event Tracking**: Use a hash key to store events from the last hour. Set each event's TTL to one hour. Use `HLEN` to count events from the past hour. @@ -201,4 +206,4 @@ In practice, your hashes are limited only by the overall memory on the VMs hosti ## Learn more * [Redis Hashes Explained](https://www.youtube.com/watch?v=-KdITaRkQ-U) is a short, comprehensive video explainer covering Redis hashes. -* [Redis University's RU101](https://university.redis.com/courses/ru101/) covers Redis hashes in detail. \ No newline at end of file +* [Redis University's RU101](https://university.redis.com/courses/ru101/) covers Redis hashes in detail.