Skip to main content
Use ZINTER to get the members that appear in every one of the given sorted sets. <numkeys> states how many keys follow. By default the score of each member in the result is the sum of its scores across all the inputs, which is what makes intersections useful for combining rankings. WEIGHTS multiplies each input’s scores by a factor before they are combined, so one source can count more than another, and AGGREGATE replaces the sum with MIN or MAX. WITHSCORES returns the computed scores along with the members. The result is not stored; use ZINTERSTORE to keep it or ZINTERCARD when only the size matters.

Syntax

Arguments

Important points

  • numkeys must equal the number of key arguments that immediately follow it.
  • Pair-based results may be flattened into one alternating array in RESP2 while RESP3 preserves nested pairs or a map.
  • 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 TLS REDIS_URL from the Upstash console. REST examples use UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN.
This command is not supported yet in @upstash/redis.