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 ZINTERSTORE command #1513

Merged
merged 7 commits into from
Jun 8, 2024
Merged

Conversation

adarovadya
Copy link
Collaborator

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.

@adarovadya adarovadya requested a review from a team as a code owner June 3, 2024 10:49
@adarovadya adarovadya changed the title Zinterstore node Node: Zinterstore node Jun 3, 2024
Copy link
Collaborator

@Yury-Fridlyand Yury-Fridlyand left a comment

Choose a reason for hiding this comment

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

Comment on lines 1889 to 1891
* 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.
Copy link
Collaborator

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.

Copy link
Collaborator Author

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/BaseClient.ts Show resolved Hide resolved
node/src/Commands.ts Outdated Show resolved Hide resolved
node/src/Commands.ts Outdated Show resolved Hide resolved
node/src/Commands.ts Outdated Show resolved Hide resolved
// args.push(`${key}`);
// });
const weights = keyWeightPairs.map(([_, weight]) => weight);
if (weights.some((weight) => weight !== 1)) {
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 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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

node/src/Commands.ts Show resolved Hide resolved
node/src/Transaction.ts Show resolved Hide resolved
@@ -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();
Copy link
Collaborator

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 Show resolved Hide resolved
node/src/Commands.ts Show resolved Hide resolved
node/src/Commands.ts Show resolved Hide resolved
node/src/Transaction.ts Show resolved Hide resolved
node/tests/SharedTests.ts Outdated Show resolved Hide resolved
* 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.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Valkey docs

@adarovadya adarovadya changed the title Node: Zinterstore node Node: Add ZINTERSTORE command Jun 6, 2024
Copy link
Collaborator

@avifenesh avifenesh left a 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))
Copy link
Collaborator

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.

@adarovadya adarovadya merged commit 2af6a18 into valkey-io:main Jun 8, 2024
8 checks passed
cyip10 pushed a commit to Bit-Quill/valkey-glide that referenced this pull request Jun 24, 2024
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants