?
?
1.Set
Set is an unordered collection of type string, and its reference source should belong to the set in the STL.
?
The set element can contain a maximum of (2 of 32 square-1) elements.
The set is implemented by a hash table, and the hash table is automatically resized as it is added or deleted.
?
?
2. CRUD
- Smembers S1
- Sadd:
Sadd Key member adds a string element to the set set of key corresponding to the successful return 1, if the element and the set returned in the collection 0,key the corresponding set does not exist return error
- Sadd S1 Hello
?
- Srem:
Srem Key member removes the given element from the key corresponding set, returns 1 successfully, if the member does not exist in the collection or the key does not exist return 0, if the key corresponding to a value other than the set type returns an error
- Srem S1 Hello
- Spop S1
?
- Srandmember S1
?
- Smove S1 S2 Hello3
?
- Sismember S1 Hello4
?
- SCard S2
?
3. Collection commands
- sinter S1 s2
?
- Sinterstore S3 S1 S2
?
- Sunion (for a set of two sets, similar to sinter)
- Sunionstore (Find the set of two sets and store them in the third collection, similar to Sinterstore)
- Sdiff (Find the difference set of two sets, similar to sinter)
- Sdiffstore (Find the set of two sets and store them in the third collection, similar to Sinterstore)
Redis Set Command