There's more...
The maximum number of elements that can be put in a Redis set is 223 - 1.
There is a command called SMEMBERS that can be used to list all elements in a set, however, similar to what we mentioned for HGETALL in Using the hash data type, using SMEMBERS in a large set may block the server, and therefore is not recommended. SSCAN should be used instead for large sets. The usage of SSCAN is very similar to the HSCAN command, which we introduced in Using the hash data type.
Redis provides a group of commands for union (SUNION, SUNIONSTORE), intersection (SINTER, SINTERSTORE) and difference (SDIFF, SDIFFSTORE) operations between sets. The commands without the STORE postfix simply return the resulting set of corresponding operations, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access