Redis Data Types Cheat Sheet/Store difference result

Write the difference into a destination set.

Section: Sets

Store difference result

bash
bash
SDIFFSTORE result:set set:a set:b

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Sets
Difference of sets
Return members in the first set but not others.
OpenIn sheetbashsame section
Add members to a set
Insert unique set members.
OpenIn sheetbashsame section
Remove members from a set
Remove members from a set.
OpenIn sheetbashsame section
List all members
Return every member of a set.
OpenIn sheetbashsame section
Get set size
Return the number of unique members.
OpenIn sheetbashsame section
Check membership
Return whether a member exists in the set.
OpenIn sheetbashsame section