1 . Sadd num a B C add three ABC elements to the num set 2 . Srem num B: delete Element B from the num set 3 . Smembers num get all elements in the num set 4 . Sismember num C judge whether C exists in the num set ================================== 5 . Operation sadd num a B c sadd num2 a B c d difference set (calculate the portion on the left more than the portion on the right): sdiff num 2 Returns the null sdiff num2 num and returns the intersection of D (the part that is simultaneously on the left and right) sinter num num2 returns a B c Union (merges the elements on both sides of the left and right without duplicates) sunion num num2 returns a B c d ==================================== 6 . Scard num gets the number of elements in the num set. 7 . Sdiffstore num3 num2 num: place the result of the difference set between num and num2 to the num3 set. 8 The intersection of. sinterstore and above 9 . Sunionstore same as above 10 . Srandmember num count random acquisition of Random Elements in count num
11. spop num randomly pops up an element from the num set.