Back to Redis

ZREMRANGEBYSCORE

content/commands/zremrangebyscore.md

latest1.0 KB
Original Source

Removes all elements in the sorted set stored at key with a score between min and max (inclusive).

Examples

{{% redis-cli %}} ZADD myzset 1 "one" ZADD myzset 2 "two" ZADD myzset 3 "three" ZREMRANGEBYSCORE myzset -inf (2 ZRANGE myzset 0 -1 WITHSCORES {{% /redis-cli %}}

Redis Software and Redis Cloud compatibility

| Redis Software | Redis Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> | |:----------------------|:-----------------|:------| | <span title="Supported">✅ Standard</span> <span title="Supported"><nobr>✅ Active-Active</nobr></span> | <span title="Supported">✅ Standard</span> <span title="Supported"><nobr>✅ Active-Active</nobr></span> | |

Return information

{{< multitabs id="zremrangebyscore-return-info" tab1="RESP2" tab2="RESP3" >}}

Integer reply: the number of members removed.

-tab-sep-

Integer reply: Number of members removed.

{{< /multitabs >}}