Add example script showing how to watch a key, run multiple commands as a transaction and catch any WatchError that occurs.
See original GitHub issueAdd 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.
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:6 (3 by maintainers)
Hi @sailingwithsandeep, I’ve assigned this to you 😃 we look forward to receiving your PR in the next couple of days. Please check out our guidelines and have fun!
https://redis.io/community/hacktoberfest
Hello, I would love to work on this. @SuzeShardlow @simonprickett