Skip to content

Conversation

@samanebi
Copy link

@samanebi samanebi commented Sep 27, 2024

This command is the combination of HGET and HDEL. It works similar to GETDEL. I was using Redis in our company and I came across the need to have such command. We had to split the delete process by using HGET and then HDEL. This required using pipelines. But if such command exist, It would be a lot easier to have this use case.

This command is exactly using HDEL code. The only difference is that it is adding deleted key values to reply. In HDEL we can see that before deleting we retrieve the key values so I used this capability for this command.

@samanebi samanebi marked this pull request as ready for review September 27, 2024 08:46
@samanebi
Copy link
Author

Can I get you opinion about this?

@sundb

@sundb
Copy link
Collaborator

sundb commented Oct 13, 2024

maybe it's more reasonable to extend HDEL to support GET option?
ping @oranagra

@oranagra
Copy link
Member

HDEL is not extensible (syntax issues), out of these two options i'd go with HGETDEL, but i'm not sure it popular enough to justify a specific command. ping @LiorKogan.

@LiorKogan
Copy link
Member

LiorKogan commented Oct 13, 2024

Now that we support Hash Field Expiration, we have an internal PRD with a suggestion for an HGETF command: For each specified field: get its value and optionally set its remaining time to live / UNIX expiration timestamp in seconds / milliseconds

HGETF is a superset of the suggested HGETDEL: fields can be fetched and deleted immediately by, e.g., setting their expiration to UNIX time 0 (similar to GETEX).

Hence, I suggest to introduce HGETF instead.

@samanebi
Copy link
Author

Now that we support Hash Field Expiration, we have an internal PRD with a suggestion for an HGETF command: For each specified field: get its value and optionally set its remaining time to live / UNIX expiration timestamp in seconds / milliseconds

HGETF is a superset of the suggested HGETDEL: fields can be fetched and deleted immediately by, e.g., setting their expiration to UNIX time 0 (similar to GETEX).

Hence, I suggest to introduce HGETF instead.

That seems like a good idea. I can proceed with implementing HGETF.

But i think HGETDEL is more straightforward. by HGETF basically we leave the delete operation to another job that determines the expired fields after the execution of command. Or we can check if the expiry time is zero and delete the field immediately in HGETF and so not proceed with the rest of process. The second approach seems to be easier but it entangles two separate use cases in HGETF with an 'if' statement. HGETDEL returns and deletes, so there is no conditional operation.

But at the end I am ok with HGETF as well and will be happy to help you implementing it.

@sundb
@oranagra

@samanebi
Copy link
Author

samanebi commented Oct 19, 2024

Any other opinion on this ? what do you think I should do ?
@sundb
@oranagra
@LiorKogan
@ShooterIT

@samanebi
Copy link
Author

any updates?
@sundb
@oranagra
@LiorKogan
@ShooterIT

@sundb
Copy link
Collaborator

sundb commented Oct 23, 2024

@samanebi i think we need some time to make the decision, i'll let you know if any news. thanks.

@samanebi
Copy link
Author

any decisions or news ? it has been long time

@sundb
@ShooterIT
@oranagra
@LiorKogan

@CLAassistant
Copy link

CLAassistant commented Dec 31, 2024

CLA assistant check
All committers have signed the CLA.

@samanebi
Copy link
Author

samanebi commented Feb 9, 2025

kindly reminded . code review
@sundb
@ShooterIT
@oranagra
@LiorKogan

Copy link
Collaborator

@sundb sundb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now this command is exactly the same as hdel, is it not finished yet?

@samanebi
Copy link
Author

Hi @sundb . Thanks for code review . all of your suggestion resolved .

@samanebi
Copy link
Author

i am facing conflicts with StackExchange/StackExchange.Redis#2863 @sundb

@sundb
Copy link
Collaborator

sundb commented Aug 19, 2025

Close via #13798

@sundb sundb closed this Aug 19, 2025
@github-project-automation github-project-automation bot moved this from Todo to Done in Redis 8.2 Aug 19, 2025
@sundb sundb removed this from Redis 8.2 Aug 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants