Lua脚本将空数组转换为对象。如何避免这种转换?
test.lua
local json_str = '{\"items\":[],\"properties\":{}}'
return cjson.encode(cjson.decode(json_str))
输出
redis-cli --eval test.lua
"{\"items\":{},\"properties\":{}}"
这里的items是一个数组[],但输出结果是一个对象{}