ZINTER numkeys key [key ...] [WEIGHTS weight [weight ...]] [AGGREGATE SUM|MIN|MAX] [WITHSCORES]

ZINTER 命令类似于 ZINTERSTORE ,不同的是他不存储结果集,而是把结果集返回给客户端。

关于 WEIGHTSAGGREGATE 选项,参考 ZUNIONSTORE.

*返回值

数组: 返回结合的交集(使用 WITHSCORES 参数时,可以返回scores

*例子

redis>  ZADD zset1 1 "one"
(integer) 1
redis>  ZADD zset1 2 "two"
(integer) 1
redis>  ZADD zset2 1 "one"
(integer) 1
redis>  ZADD zset2 2 "two"
(integer) 1
redis>  ZADD zset2 3 "three"
(integer) 1
redis>  ZINTER 2 zset1 zset2
ERR Unknown or disabled command 'ZINTER'
redis>  ZINTER 2 zset1 zset2 WITHSCORES
ERR Unknown or disabled command 'ZINTER'
redis>