Skip to main content

ZINTER

Note

Official reference: ZINTER.

Read an intersection and aggregate member scores.

Syntax

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

numkeys must match the number of following source keys.

WEIGHTS supplies one weight per source key, in key order; the default is 1. AGGREGATE chooses sum, minimum or maximum, default SUM.

Results

ReturnRowsContent
ResultSetmultipleELEMENT field, STRING type
SCORE field, DOUBLE type (when using WITHSCORES)

Example

ZADD demo:ranking 10 alice 20 bob
ZADD demo:other 30 alice
ZINTER 2 demo:ranking demo:other WEIGHTS 1 2 AGGREGATE SUM WITHSCORES