The problem/use-case that the feature addresses
The introduction of HEXPIRE opens a lot of possibilities. However, there is still one limitation: you cannot set a key and its expire time atomically, like you can with SET. Specifically, the use-case I'm interested in is adding a key with an expire time only if it's not present. At the time of writing, doing this requires a transaction with optimistic locking.
Description of the feature
Updating the HSET command to have options similar to the SET command (NX, EX, XX...) would allow for this.
Alternatives you've considered
Doing the sequence of commands in a transaction and using optimistic locking for the NX and XX options works, but is far from ideal.
Additional information
Comment From: sundb
@cijaaimee thanks, it seems to be a reasonable feature, but it could also be a new command instead of implementing it based on hset.
Comment From: 13ilya-old
I'd like that too https://github.com/redis/redis/issues/13459 for the company in 8. :-)