Redis Data Types Cheat Sheet/Difference of sets

Return members in the first set but not others.

Section: Sets

Difference of sets

bash
bash
SDIFF 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
Store difference result
Write the difference into a destination set.
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