1. Sadd
Format: Sadd ' name ' ' value '
Add value to the set named name.
2. Smembers
Format: smembers ' name '
Returns all the value inside the set named name.
3. Srem
Format: Srem ' name ' ' value '
The value is removed from the set named name.
4. Spop
Format: Spop ' name '
Randomly pops an element from the set named Name, and deletes the element.
5. Sdiff
Format: Sdiff ' name1 ' name2 '
Returns the difference between the set with the name Name1 and the set named Name2. Returns an element in the name2 that is not in name1, as standard with name1.
6. Sdiffstore
Format: Sdiffstore ' name1 ' name2 ' Name3 '
The difference between set with name Name1 and set named Name2 is stored in the set named Name3.
7. Sinter ' name1 ' name2 ' (intersection)
Sinterstore ' name1 ' name2 ' Name3 '
8. Sunion ' name1 ' name2 ' (set)
Sunionstore ' name1 ' name2 ' Name3 '
9. Smove
Format: Smove ' name1 ' name2 ' value '
The value in the set named Name1 is moved to the set named Name2.
Ten. SCard
Format: SCard ' name '
Returns the number of elements in a set named name.
Sismembers.
Format: sismembers ' name ' ' value '
Determines whether the value element is inside a set named name.
Srandmember.
Format: Srandmember ' name '
A random element pops up from a set named name, but does not delete the element.
This article is from the "Bronze Gong" blog, please be sure to keep this source http://jaeger.blog.51cto.com/11064196/1772273
Redis data type operation (iv)--set