Skip to content

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.

Copy link
Collaborator

@mgravell mgravell left a comment

Choose a reason for hiding this comment

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

validated locally with redis:unstable

@mgravell mgravell merged commit be39ec9 into StackExchange:main Jul 10, 2025
4 of 6 checks passed
mgravell pushed a commit that referenced this pull request Jul 18, 2025
mgravell pushed a commit that referenced this pull request Jul 18, 2025
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.

2 participants