Redis SUNIONSTORE 命令类似于 SUNION 命令,但它将结果保存到 destination 集合,而不是简单地返回结果集。如果 destination 已经存在,则将其覆盖。
注意:destination 可以是 key 本身。

SUNIONSTORE destination key [key ...]
127.0.0.1:6379> SADD website www.biancheng.net www.baidu.com www. #添加一个集合成员(integer) 2127.0.0.1:6379> SADD site git python svn docker(integer) 4127.0.0.1:6379> SUNIONSTORE mysite site website(integer) 6127.0.0.1:6379> SMEMBERS mysite #将结果存储在一个目标集合mysite1) "git"2) "python"3) "docker"4) "svn"5) "www.baidu.com"6) "www.biancheng.net"