---
title: "zinterstore · RUAL Documentation"
description: "Stores the weighted intersection of sorted sets in a destination sorted set. A RUAL redis block in the redis sorted sets group. Block type: redis_zinterstore."
canonical: https://docs.rual.nl/block-types/redis/redis_zinterstore
language: en
---

# zinterstore

This block is part of the [`redis`](https://docs.rual.nl/block-types/redis) group and was last modified in core [`v15.0.3`](https://docs.rual.nl/core-versions/150003).

## Redis Key Selection Required

This block relies on a Redis key to perform its redis releated actions. You must manually select the Redis key you want to use in the flow in the blueprint using the Redis key selector modal. To access the modal, click the white button on the block.

Stores the weighted intersection of sorted sets in a destination sorted set.

- flow

- destination `value` required key of the sorted set to write

- sources `array` required keys of the sorted sets to combine, or {key, weight} objects

- weights `array` one number per source

- aggregate `value` sum, min or max

- flow

- number `number`

- success `condition`

- error `value`

- key `value`

sources is an array of sorted-set keys, or of {key, weight} objects; weights is an optional array of numbers, one per source (default 1). Each member's score is multiplied by its source's weight and combined with aggregate: sum (default), min or max. The destination and every source are keys in the entity's cache namespace, like every redis block's; the destination is overwritten. number is the size of the stored set. Refused without writing: MISSING_SOURCES, INVALID_SOURCE (an item without a key), INVALID_WEIGHTS (not a finite number, or a weights array of another length), INVALID_AGGREGATE. In simulation nothing is written: success=true with error NOT_EXECUTED_IN_SIMULATION_MODE.

| `redis zinterstore` |
| --- |
| `zinterstore` |

## Version history

Introduced in [`v15.0.3`](https://docs.rual.nl/core-versions/150003).

## Service documentation

- [External API reference](https://redis.io/commands/zinterstore/): This block wraps a third-party service. Click here for the service's own documentation of the underlying endpoint.

- [Back to `redis`](https://docs.rual.nl/block-types/redis): Return to the main group to view all sub-groups

- [Back to `redis sorted sets`](https://docs.rual.nl/block-types/redis?group=redis%20sorted%20sets): Return to the group to view all blocks within this group
