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

support for unsorted sets within zinterstore/zunionstore #182

Merged

Conversation

pinnymz
Copy link
Contributor

@pinnymz pinnymz commented Mar 30, 2020

Per Redis Labs documentation, zinterstore and zunionstore should support passing unsorted sets to these commands with an implicit score of 1.0 applied to all values within the set.

Redis has a command called ZINTERSTORE, which, when provided with SETs and ZSETs, will find those entries that are in all of the SETs and ZSETs, combining their scores in a few different ways (items in SETs are considered to have scores equal to 1).

Curiously, the ZINTERSTORE and ZUNIONSTORE command documentation make no mention of this. However, as referenced above this is officially supported, and patches ensuring this behavior have been merged accordingly.

This patch adds this functionality to the .zinterstore and .zunionstore methods so it will behave as Redis itself would.

@pinnymz pinnymz force-pushed the add_set_support_for_zinterstore_zunionstore branch from bf33411 to 3c5e9fd Compare March 30, 2020 04:23
@maneeshanand
Copy link

👍

1 similar comment
@mikecarroll
Copy link

👍

@sds sds added the enhancement label Apr 6, 2020
@sds sds merged commit 16d0078 into sds:master Apr 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants