Skip to content

ZREM

ZREM key member [member ...]

Removes the specified members by key from the sorted set. Non existing members are ignored.

Returns the number of members removed from the sorted set.

localhost:7379> ZADD users 10 alice 20 bob 30 charlie
OK 3
localhost:7379> ZRANGE users 0 60 BYSCORE
OK
1) 10, alice
2) 20, bob
3) 30, charlie
localhost:7379> ZREM users alice bob
OK 2
localhost:7379> ZRANGE users 0 60 BYSCORE
OK
1) 30, charlie