node-redis icon indicating copy to clipboard operation
node-redis copied to clipboard

How to use lua scripts in v4?

Open jatinkumarg opened this issue 4 years ago • 2 comments

Noticed the support for script() has been removed in v4. Wondering how lua scripts can be loaded in v4?

I'm trying to update the node-redis to v4 in bee-queue but getting issue with loading lua scripts here.

jatinkumarg avatar Oct 12 '22 21:10 jatinkumarg

you can define lua scripts on the client and then use them like any other command. checkout the "scripts" section in the main readme and this example file

leibale avatar Oct 20 '22 19:10 leibale

@jatinkumarg Use sendCommand(), i.e.:

const [exists] = await redis.sendCommand('script', 'exists', scriptChecksum);

compwright avatar Dec 01 '22 18:12 compwright