Skip to content

New operations of BITOP command in Redis Community Edition 8.2 #2900

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

atakavci
Copy link
Contributor

Redis CE 8.2 supports new operations often required with BITOP command;

DIFF(X, Y1, Y2, …)
members of X that are not members of any of Y1, Y2 ,…
X ∧ ¬(Y1 ∨ Y2 ∨ …)

DIFF1(X, Y1, Y2, …)
members of one or more of Y1, Y2 ,… that are not members of X
¬X ∧ (Y1 ∨ Y2 ∨ …)

ANDOR(X, Y1, Y2, …)
members of X that are also members of one or more of Y1, Y2 ,…
X ∧ (Y1 ∨ Y2 ∨ …)

ONE(X1, X2, …) -
members of exactly one of X1, X2, …
For two bitmaps this is equivalent to XOR(X1, X2) (AKA symmetric difference., X1 ⊕ X2). However, for more than two bitmaps, XOR has little practical use.
In general this is COUNT(X1, X2, …) == 1

See more details here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant