Skip to content

ZCARD.WATCH

ZCARD.WATCH key

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

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

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