Skip to content

Conversation

viktoriya-kutsarova
Copy link
Contributor

@viktoriya-kutsarova viktoriya-kutsarova commented Oct 1, 2025

This change introduces the Add HGETDEL, HGETEX and HSETEX hash commands feature as part of the features provided by the spring-data-redis project. Closes #3211.

As part of the change the following commands would be made available:

  • HGETDEL - get and delete the value of one or more fields of a given hash key. When the last field is deleted, the key will also be deleted
  • 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 - set the value of one or more fields of a given hash key, and optionally set their expiration time or time-to-live (TTL)

The new commands are available as part of the following interfaces:
(based on similar PR #3054)

  • RedisHashCommands / ReactiveHashCommands
  • HashOperations / ReactiveHashOperations / BoundHashOperations
  • StringRedisConnection
  • New enum HashFieldSetOption inside RedisHashCommands similar to SetOption in RedisStringCommands

This feature is available starting from Redis OSS version 8.0.x and later


  • You have read the Spring Data contribution guidelines.
  • You use the code formatters provided here and have them applied to your changes. Don’t submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.
  • You added yourself as author in the headers of the classes you touched. Amend the date range in the Apache license header if needed. For new types, add the license header (copy from another file and set the current year only).

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Oct 1, 2025
Signed-off-by: viktoriya.kutsarova <viktoriya.kutsarova@redis.com>
Signed-off-by: viktoriya.kutsarova <viktoriya.kutsarova@redis.com>
Signed-off-by: viktoriya.kutsarova <viktoriya.kutsarova@redis.com>
@viktoriya-kutsarova viktoriya-kutsarova force-pushed the topic/introduce-hgetdel-hgetex-hsetex-commands branch from 20a7d3f to 00e1ba2 Compare October 1, 2025 12:14
@onobc onobc self-assigned this Oct 1, 2025
onobc pushed a commit that referenced this pull request Oct 4, 2025
Adds the following commands: * HGETDEL - get and delete the value of one or more fields of a given hash key. When the last field is deleted, the key will also be deleted * 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 - set the value of one or more fields of a given hash key, and optionally set their expiration time or time-to-live (TTL) Original Pull Request: #3226 Resolves: #3211
onobc added a commit that referenced this pull request Oct 4, 2025
This commit polishes the previous commit with the following: - Add missing `@Override` tag - Update javadoc to include details for returned values - Adds the `HSETEX` command to `LettuceCommand` Original Pull Request: #3226 Resolves: #3211 Signed-off-by: Chris Bono <chris.bono@broadcom.com>
@onobc
Copy link
Contributor

onobc commented Oct 4, 2025

Thank you for the contribution @viktoriya-kutsarova - well done! I added a small polish commit here - nothing major.

Closing in favor of 8ec4736

@onobc onobc closed this Oct 4, 2025
@mp911de mp911de added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Oct 6, 2025
@mp911de mp911de added this to the 4.0 RC1 (2025.1.0) milestone Oct 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
4 participants