To add an element to a set named key:
Command: Sadd #不允许有重复的值
- 2
Delete the element in the set named key:
Command: Srem
- 3
Randomly returns and deletes an element in a set named key:
Command: Spop #随机弹出元素
Returns the difference set between all given key and the first key:
Command: Sdiff
Returns the difference between all the given key and the first key, and saves the result as another key:
Command: Sdiffstore
Returns the intersection of all given keys:
Command: Sinter
Returns the intersection of all given keys and saves the result as another key:
Command: Sinterstore
Returns the set of all the given keys:
Command: Sunion
Returns the set of all the given keys:
Command: Sunionstore
Remove the member from the set corresponding to the first key and add it to the second corresponding set:
Command: Smove
Returns the number of elements of a set named key:
Command: SCard
Test whether the member is a set element with the name key:
Command: Sismember #判断元素里的值 exists
Randomly returns an element of a set named key, but does not delete the element:
Command: Srandmember #随机返回一个元素
END
teach you how to use Redis (total 7 articles)
Set Collection type Redis