title: Redis Lua: dynamic number of keys in redis call
body: <p>I'm using a lua script to get a <code>ZINTERSTORE</code> result. What I want is to be able to give lua a dynamic number of zsets in the call such that: </p>
  
  <pre><code>redis.pcall('ZINTERSTORE', result, n, keys[1], keys[2], keys[3], keys[4], keys[5],  'AGGREGATE', 'MAX')
  </code></pre>
  
  <p>becomes something like:</p>
  
  <pre><code>redis.pcall('ZINTERSTORE', result, n, dynamic_key_list, 'AGGREGATE', 'MAX')
  </code></pre>
  
  <p>Lua's <code>table.getn</code> function lets me get the size <code>n</code>. Problem here is that if <code>dynamic_key_list</code> is a list, then redis cries loud and early with:</p>
  
  <pre><code>Lua redis() command arguments must be strings or integers
  </code></pre>
  
  <p>I've seen <a href="https://stackoverflow.com/questions/24027995/calling-redis-zunionstore-from-lua-with-variable-keys">this</a> possible solution but I don't want to iterate over the table and do the redis call every time, since I could potentially have 10-15 keys and it is an overhead I can't afford. Is there another way?</p>