0
我正在使用node_redis npm包来调用lua函数。我想要传递给lua的JavaScript对象。如何在redis lua脚本中解析Javascript对象
下面是样品JSON对象:
var feeds=[];
var feed ={};
feed.uId ="Zqr6jfu6pgqNpAKaf";
feed.kIds =[];
feed.kIds.push("2557f730-e7a9-11e6-a2e7-49a45a663faf");
feed.kIds.push("224ec110-f9cc-11e6-8f0c-cb2069561ad8");
feeds.push(feed);
我打电话eval函数来执行我的LUA脚本:
client.eval(
scriptId, //lua source
0,
feeds,
function(err, result) {
console.log(err+'------------'+result);
}
);
在Lua中如何我可以分析该对象插入有序集合所有的孩子feed.UId键