Set
SADD "user:userID1:followers" followerID1
SADD "user:userID1:followers" followerID2
SADD "user:userID2:followers" followerID1
SADD "user:userID2:followers" followerID3
-- Find the common followers between two users
SINTER "user:userID1:followers" "user:userID2:followers"
-- Get the SET values
SMEMBERS "user:userID1:followers"
-- Gets the size of the set.
SCARD "user:userID1:followers"
-- Find out whether followerID1 is part of this set
SISMEMBER user:userID1:followers followerID1
Last updated