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

#652: feature: HRANDFIELD command #696

Merged
merged 9 commits into from
Sep 26, 2024

Conversation

Indranil0603
Copy link
Contributor

@Indranil0603 Indranil0603 commented Sep 23, 2024

Closes #652

Adds support for the HRANDFIELD command. This command returns one or more random fields from the hash stored at the specified key. If the "WITHVALUES" option is provided, both fields and their corresponding values are returned. It supports fetching a specific number of fields based on the count argument, with positive values returning unique fields and negative values allowing repeated selections.

Redis doc: HRANDFIELD

Changes:

  • Implementation - evalHRANDFIELD
  • Unit tests - testEvalHRANDFIELD
  • Integration tests - TestHRANDFIELD

@Indranil0603 Indranil0603 changed the title Added HRANDFIELD command with tests feature: HRANDFIELD command Sep 23, 2024
@JyotinderSingh
Copy link
Collaborator

Could you please resolve the conflicts?

@JyotinderSingh JyotinderSingh self-requested a review September 25, 2024 02:53
@Indranil0603
Copy link
Contributor Author

Hi @JyotinderSingh I have resolved the conflicts

internal/eval/tmp/main Outdated Show resolved Hide resolved
Copy link
Collaborator

@JyotinderSingh JyotinderSingh left a comment

Choose a reason for hiding this comment

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

Thanks for adding support for HRANDFIELD command @Indranil0603! I've changed the structure of the tests and the eval implementation a little to make it more readable.

Please go through it for future reference.

@JyotinderSingh JyotinderSingh changed the title feature: HRANDFIELD command #652: feature: HRANDFIELD command Sep 26, 2024
@JyotinderSingh JyotinderSingh merged commit 7c2d732 into DiceDB:master Sep 26, 2024
2 checks passed
@Indranil0603 Indranil0603 deleted the feature_HRANDFIELD branch September 27, 2024 16:54
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.

Add support for command HRANDFIELD
3 participants