title: Redis: how to delete multiple keys matching pattern?
body: <p>I need to remove 10 000 keys.</p>
  
  <ol>
  <li><p>What is better way: to exec this kind of script</p>
  
  <p>EVAL "return redis.call('del', unpack(redis.call('keys', ARGV[1])))" 0 "<strong>ROOT</strong>"</p></li>
  <li><p>May be better is to set expiration time and Redis will remove them?
  But how to do it in console using Lua script?</p></li>
  </ol>
  
  <p>The script (see above) works because del comman dhas a format:</p>
  
  <pre><code>del key1 key2 ...
  </code></pre>
  
  <p>But Expire works only for 1 key. </p>
  
  <p>Is it possible to do it in lua script?</p>
  
  <p>For example: my application creates some search results cache and set for every page ttl = 3600. But user wants to clear cache immediately, i.e. delete all matching keys or set smaller expiration for them.</p>