-
Notifications
You must be signed in to change notification settings - Fork 50
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 ZINTERSTORE command #1513
Conversation
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.
Add a test for cross slot case to https://github.com/aws/glide-for-redis/blob/eb3365a2fe65fc2b669c0f4165181ed7992e4042/node/tests/RedisClusterClient.test.ts#L277-L278
node/src/BaseClient.ts
Outdated
* When in cluster mode, `destination` and all keys in `keys` must map to the same hash slot. | ||
* See https://redis.io/commands/zinterstore for more details. |
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.
Do we need blank lines between doc sections? Please compare with other multi key commands.
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.
seems its ok , compared to other
node/src/Commands.ts
Outdated
// args.push(`${key}`); | ||
// }); | ||
const weights = keyWeightPairs.map(([_, weight]) => weight); | ||
if (weights.some((weight) => weight !== 1)) { |
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 you need to change the approach - you need to submit weights only if user gave them, regardless of their values, even if all of them are 1 or 1.0.
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.
Python takes the same approach https://github.com/aws/glide-for-redis/pull/1388/files
7611d05
to
ff29207
Compare
f27bcca
to
0e963c9
Compare
@@ -229,6 +229,8 @@ export async function transactionTest( | |||
const key9 = "{key}" + uuidv4(); | |||
const key10 = "{key}" + uuidv4(); | |||
const key11 = "{key}" + uuidv4(); // hyper log log | |||
const key12 = "{key}" + uuidv4(); |
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.
nit: add a note of what type of data you're storing in these keys
node/src/BaseClient.ts
Outdated
* Computes the intersection of sorted sets given by the specified `keys` and stores the result in `destination`. | ||
* If `destination` already exists, it is overwritten. Otherwise, a new sorted set will be created. | ||
* When in cluster mode, `destination` and all keys in `keys` must map to the same hash slot. | ||
* See https://redis.io/commands/zinterstore for more details. |
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.
Valkey docs
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.
Fix Linting.
@@ -1,4 +1,5 @@ | |||
#### Changes | |||
* Node: Added ZINTERSTORE command ([#1513](https://github.com/aws/glide-for-redis/pull/1513)) |
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.
Probably add this entry after line 16 for sequential order.
* add zinterstore command node * Node: added zinterstore command * Node: added zinterstore command * Node: add ZINTERSTORE command * split test to functions and fix doc * change links to valkey * fix lint errors --------- Co-authored-by: Ubuntu <ubuntu@ip-172-31-20-143.eu-west-1.compute.internal>
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.