In Redis I run a Lua script through CLI like this:-
$ redis-cli --eval debug_script.lua key1 key2 key3 key4 , arg1 arg2
So, my Lua script accepts 4 keys and 2 arguments.
Now I want to run the same script in Node.js.
I am using this library for importing Redis in my app.
I didn't find any example which tells about the arguments of redisClient.eval(...)
function for executing the Lua script.
Thus I am just hitting something random that might work. But nothing seems to work.
My app.js goes like this:
var redis = require("redis")
var client = redis.createClient();
// my hit and trial guess
client.eval(["script_file.lua", 1 "score" 0 10 , "meeting_type:email" meeting_status:close], function(err, res){
console.log("something happened\n");
});
My question: How to execute below command using node.js, so that it returns the same thing as it does when executed through CLI(command-line-interface).
$ redis-cli --eval debug_script.lua key1 key2 key3 key4 , arg1 arg2