Hello!
On Sun, Sep 15, 2013 at 2:46 PM, Anton Heryanto wrote:
> first thank for great nginx module
> openresty is very interesting platform and fast
>
Glad you like it!
> local acl = r:sunion("role:1:acl", "role:1:acl") //how can i query sunion
> with respective key dynamically (instead of hard code it)
[...]
>
> is there a way i can pass table array as parameter to lua-resty-redis
> or how to query row command ( i have inspect lua code it seem local so can
> be accessed outside module)
>
This is a FAQ in general Lua programming.
To answer your question, just use Lua's standard function unpack() for
to convert a Lua array-like table into a list. For example,
local roles = { "role:1:acl", "role:2:acl" }
local acl = r:sunion(unpack(roles))
where the "roles" Lua table can be constructed by your own Lua loops,
of course. See also
http://www.lua.org/manual/5.1/manual.html#pdf-unpack
Best regards,
-agentzh