-
Notifications
You must be signed in to change notification settings - Fork 71
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
Conversation
Signed-off-by: Shoham Elias <[email protected]>
89bf5a5
to
53c1be5
Compare
* 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* 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[]> { |
There was a problem hiding this comment.
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
Can we close this because of duplicate PRs? #2067 @acarbonetto |
Closing - this command is completed under #2067 |
No description provided.