Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extend HSETEX with NX option #3265

Open
romange opened this issue Jul 4, 2024 · 1 comment · May be fixed by #3295
Open

extend HSETEX with NX option #3265

romange opened this issue Jul 4, 2024 · 1 comment · May be fixed by #3295
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed Next Up task that is ready to be worked on and should be added to working queue

Comments

@romange
Copy link
Collaborator

romange commented Jul 4, 2024

Currently, HSETNX has exactly 3 arguments.
We can add the forth optional TTL in seconds for the field to expire (see also https://www.dragonflydb.io/docs/command-reference/hashes/hsetex).

Update: See the comment below - instead of chaning HSETNX, we can extend HSETEX

@romange romange added enhancement New feature or request help wanted Extra attention is needed Next Up task that is ready to be worked on and should be added to working queue labels Jul 4, 2024
@romange
Copy link
Collaborator Author

romange commented Jul 4, 2024

Actually, HSETEX is considered to be experimental and I think we can still improve/extend it in such that it won't break the existing users.
So https://www.dragonflydb.io/docs/command-reference/hashes/hsetex has the following format:
HSETEX key seconds field value [field value ...]
we can introduce an optional NX like this:
HSETEX key [NX] seconds field value [field value ...]

since the parser expects integer as the second argument, this extension will still be well defined and easily parse-able.

@romange romange changed the title extend HSETNX with TTL expiry extend HSETEX with NX option Jul 4, 2024
BagritsevichStepan added a commit to BagritsevichStepan/dragonfly that referenced this issue Jul 9, 2024
BagritsevichStepan added a commit to BagritsevichStepan/dragonfly that referenced this issue Jul 9, 2024
BagritsevichStepan added a commit to BagritsevichStepan/dragonfly that referenced this issue Jul 9, 2024
BagritsevichStepan added a commit to BagritsevichStepan/dragonfly that referenced this issue Jul 9, 2024
BagritsevichStepan added a commit to BagritsevichStepan/dragonfly that referenced this issue Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed Next Up task that is ready to be worked on and should be added to working queue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants