Redis参考手册
Redis Sunion 命令
Redis Sunion 命令
Redis Sunion 命令
Redis 集合(Set)
Redis Sunion 命令返回给定集合的并集。不存在的集合 key 被视为空集。
语法
redis Sunion 命令基本语法如下:
redis 127.0.0.1:6379> SUNION KEY KEY1..KEYN
可用版本
>= 1.0.0
返回值
并集成员的列表。
实例
redis> SADD key1 "a" (integer) 1 redis> SADD key1 "b" (integer) 1 redis> SADD key1 "c" (integer) 1 redis> SADD key2 "c" (integer) 1 redis> SADD key2 "d" (integer) 1 redis> SADD key2 "e" (integer) 1 redis> SUNION key1 key2 1) "a" 2) "c" 3) "b" 4) "e" 5) "d" redis>
Redis 集合(Set)
Redis Sunion 命令 |
---|
Redis 是一个开源的使用 ANSI C 语言编写、遵守 BSD 协议、支持网络、可基于内存亦可持久化的日志型、Key-Value 数据库,并提供多种语言的 API。 它通常被称为数据结构服务器,因为值( value )可以是 字符串( String ), 哈希(Map),列表(list),集合( sets ) 和 有序集合( sorted sets )等类型。
主页 | https://redis.io/ |
源码 | https://github.com/antirez/redis |
发布版本 | 4.0.2 |