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

Node: add SRANDMEMBER command #1938

Closed
wants to merge 1 commit into from

Conversation

shohamazon
Copy link
Collaborator

No description provided.

@shohamazon shohamazon requested a review from a team as a code owner July 15, 2024 11:06
Signed-off-by: Shoham Elias <[email protected]>
@shohamazon shohamazon added the node Node.js wrapper label Jul 15, 2024
* See https://valkey.io/commands/srandmember for more details.
*
* @param key - The key from which to retrieve the set member.
* @returns a random element from the set, or null if `key` does not exist.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
* @returns a random element from the set, or null if `key` does not exist.
* @returns A random element from the set, or null if `key` does not exist.

Should we capitalize? If not, please ignore

* @param count - The number of members to return.
* If `count` is positive, returns unique members.
* If `count` is negative, allows for duplicates members.
* @returns a list of members from the set. If the set does not exist or is empty, an empty list will be returned.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
* @returns a list of members from the set. If the set does not exist or is empty, an empty list will be returned.
* @returns A list of members from the set. If the set does not exist or is empty, an empty list will be returned.

Same here

* See https://valkey.io/commands/srandmember for more details.
*
* @param key - The key from which to retrieve the set member.
* Command Response - a random element from the set, or null if `key` does not exist.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
* Command Response - a random element from the set, or null if `key` does not exist.
* Command Response - A random element from the set, or null if `key` does not exist.

* @param count - The number of members to return.
* If `count` is positive, returns unique members.
* If `count` is negative, allows for duplicates members.
* Command Response - a list of members from the set. If the set does not exist or is empty, an empty list will be returned.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
* Command Response - a list of members from the set. If the set does not exist or is empty, an empty list will be returned.
* Command Response - A list of members from the set. If the set does not exist or is empty, an empty list will be returned.

public async srandmemberCount(
key: BulkString,
count: number,
): Promise<BulkString[]> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we need to merge #1953 ahead of this

@GumpacG
Copy link
Collaborator

GumpacG commented Aug 6, 2024

Can we close this because of duplicate PRs? #2067 @acarbonetto

@acarbonetto
Copy link
Contributor

Closing - this command is completed under #2067

@acarbonetto acarbonetto closed this Aug 7, 2024
@shohamazon shohamazon deleted the node/srandmember branch September 23, 2024 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
node Node.js wrapper
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants