node-redis
node-redis copied to clipboard
[v5][LUA] no updates for the new scripts interface, the example does not work
Description
Hi.
After upgrading to version 5, LUA scripts don't work. The transformArguments doesn't exist anymore, and the parseCommand is required. The example at https://github.com/redis/node-redis/blob/master/examples/lua-multi-incr.js also doesn't work due to being outdated. Can someone explain the migration guide?
Okay, I found it in the sources.
the old syntax
transformArguments(key: string, decrement: number) {
return [key, decrement.toString()];
},
a new one
parseCommand(parser, key: string, decrement: number) {
parser.pushKey(key);
parser.push(decrement.toString());
},
@xr0master thanks for flagging this, we will update the docs/examples ( or maybe you would like to contribute? )