ZUNION to get every member that appears in at least one of the given sorted sets.
<numkeys> states how many keys follow. A member present in several inputs gets the sum of its scores by default, which is how scores from different sources are combined; WEIGHTS scales each input before that, and AGGREGATE replaces the sum with MIN or MAX. WITHSCORES returns the computed scores.
The result is computed on each call and not stored; use ZUNIONSTORE to keep it.
Syntax
Arguments
Important points
numkeysmust equal the number of key arguments that immediately follow it.- RESP2 represents floating-point reply values as bulk strings; RESP3 may use native double replies. Client libraries commonly decode either form to a language number.
Response
The reply reports the result of the operation. Error replies have the same shape in RESP2 and RESP3 and are surfaced as exceptions by the SDKs below.Client libraries often decode bulk strings, maps, sets, and numeric strings into language-native values. The table describes the Redis wire reply.
Examples
TCP examples use the TLSREDIS_URL from the Upstash console. REST examples use UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN.
Redis CLI
Redis CLI
@upstash/redis
@upstash/redis
upstash_redis
upstash_redis
ioredis
ioredis
node-redis
node-redis
redis-py
redis-py
go-redis
go-redis
jedis
jedis
redis-rs
redis-rs