set 运行任意多个不同的元素存储到集合中(不能重复 无序 相对应list单元素操作 集合操作无需遍历集合)
命令
SADD set element [element ...]无元素 移除返回值为0

命令
SREM set element [element ...]

命令
SMOVE source target element移动不存在的元素 操作失败 返回值为0 对于移动值与目标集合中的值重复 覆盖

命令
SMEMBERS set

命令
SCARD set

命令
SISMEMBER set element

命令
SRANDMEMBER set [count]

# 声明只是为了方便理解
if n >= scard music-plus:
SMEMBERS music-plus


命令
SPOP key [count]默认只移除一个元素

命令
SINTER set [set ...]

命令
SINTERSTORE destination_key set [set ...]

命令
SUNION set [set ...]和SUNIONSTORE destination_key set [set ...]和上面的交集命令相似


命令
SDIFF set [set ...]和SDIFFSTORE destination_key set [set ...]

原文:https://www.cnblogs.com/my-ordinary/p/12631938.html