Description
Add an example script that shows how to watch a key and perform multiple commands on it in a transaction, catching any WatchError
that occurs if the key changes.
Your example can be based on the code example here: https://github.com/redis/node-redis/blob/master/docs/isolated-execution.md, the best example to implement would be a check and set operation as described here https://redis.io/docs/manual/transactions/#cas
Name your file transaction-with-watch.js
. Pay attention to the guidelines for adding an example to ensure that your contribution can be merged.
This is part of our participation in Hacktoberfest 2022. Learn how to complete this issue here: https://redis.io/community/hacktoberfest/
Need help or want to talk to us? Join us on Discord where we have a dedicated Hacktoberfest channel: https://discord.gg/ueQwKUh5Z3
If you're interested in taking this issue on, please mention @simonprickett and @SuzeShardlow in the comments and ask to be assigned.