0
在Redis的运行Lua中我经历了这样的命令行运行Lua中: -执行Redis的eval命令中的NodeJS
$ redis-cli --eval debug_script.lua key1 key2 key3 key4 , arg1 arg2
所以,我的Lua脚本接受4个按键和2个参数。
现在我想在Node.js中运行相同的脚本。
我正在使用this库在我的应用程序中导入Redis。
我没有找到任何例子来说明执行Lua脚本的redisClient.eval(...)
函数的参数。
因此,我只是打了一些随机可能工作。但似乎没有任何工作。
我app.js是这样的:
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");
});
我的问题:如何使用Node.js,因为它确实在通过CLI(命令行执行的如何执行下面的命令,所以它返回同样的事情-接口)。
$ redis-cli --eval debug_script.lua key1 key2 key3 key4 , arg1 arg2