Introduction
SISMEMBER helps you quickly check if a value is inside a set. It tells you yes or no.
SISMEMBER helps you quickly check if a value is inside a set. It tells you yes or no.
SISMEMBER key member
key is the name of the set you want to check.
member is the value you want to find in the set.
SISMEMBER online_users user123
SISMEMBER featured_products 98765SISMEMBER blacklist spam@example.com
First, add three colors to the 'colors' set. Then check if 'green' is in the set (should be yes). Finally, check if 'yellow' is in the set (should be no).
SADD colors red green blue SISMEMBER colors green SISMEMBER colors yellow
SISMEMBER returns 1 if the member exists, 0 if it does not.
Sets in Redis do not allow duplicate members.
Use SISMEMBER for fast membership checks without scanning the whole set.
SISMEMBER checks if a value is in a Redis set.
Returns 1 for yes, 0 for no.
Great for quick membership tests in lists stored as sets.
SISMEMBER do?SISMEMBER key member, so SISMEMBER fruits apple is correct.SISMEMBER colors yellow?SISMEMBER colors without specifying a member. What will happen?Pass the test and this pattern moves unknown