Introduction
These commands help you combine or compare groups of unique items stored in sets, making it easy to find common, different, or all items between them.
SUNION key1 [key2 ...] SINTER key1 [key2 ...] SDIFF key1 [key2 ...]
SUNION setA setB
SINTER setA setB
SDIFF setA setB
SADD setA apple banana cherry SADD setB banana cherry date SUNION setA setB SINTER setA setB SDIFF setA setB
SUNION do when applied to multiple sets?set1 and set2 in Redis?SINTER.SINTER key1 key2 .... SINTER set1 set2 matches this exactly.set1 = {"apple", "banana", "cherry"}set2 = {"banana", "date", "fig"}SINTER set1 set2?SDIFF set1 set2 but get an unexpected empty result. Given:set1 = {"cat", "dog"}set2 = {"cat", "dog", "mouse"}setA = {"red", "blue", "green"}setB = {"blue", "yellow"}setC = {"green", "yellow", "black"}setA but not in setB or setC?Pass the test and this pattern moves unknown