ZUNIONSTORE

Since 1.1.0Sorted sets

Syntax

ZUNIONSTORE destination numkeys key [key ...] [WEIGHTS ...] [AGGREGATE SUM|MIN|MAX|COUNT]
  • Flags: movablekeys, write
  • ACL categories: @slow, @sortedset, @write
  • Arity: -4

Stores what ZUNION would return at destination, replacing whatever was there.

Reply

  • The number of members stored.

Examples

> ZADD s1 1 a 2 b 3 c
(integer) 3
> ZADD s2 10 b 20 c 30 d
(integer) 3
> ZUNIONSTORE out2 2 s1 s2 AGGREGATE MIN
(integer) 4