Skip to content

ZCOUNT.WATCH

ZCOUNT.WATCH key min max

ZCOUNT.WATCH creates a query subscription over the ZCOUNT command. The client invoking the command will receive the output of the ZCOUNT command (not just the notification) whenever the value against the key is updated.

You can update the key in any other client. The ZCOUNT.WATCH client will receive the updated value.

client1:7379> ZADD users 1 alice 2 bob 3 charlie
OK 3
client1:7379> ZCOUNT.WATCH users 1 5
entered the watch mode for ZCOUNT.WATCH users
client2:7379> ZADD users 4 daniel
OK 1
client1:7379> ...
entered the watch mode for ZCOUNT.WATCH users
OK [fingerprint=7042915837159566899] 4