title: How to search Lua table values
body: <p>I have a project that calls for a relational database like structure in an environment where an actual database isn't possible. The language is restricted to Lua, which is far from being my strongest language. I've got a table of tables with a structure like this:</p>
  
  <pre><code>table={
    m:r={
      x=1
      y=1
      displayName="Red"
    }
    m:y={
      x=1
      y=2
      displayName="Yellow"
    }
  }
  </code></pre>
  
  <p>Building, storing and retrieving the table is straightforward enough. Where I'm running into issues is searching it. For the sake of clarity, if I could use SQL I'd do this:</p>
  
  <pre><code>SELECT * FROM table WHERE displayName="Red"
  </code></pre>
  
  <p>Is there a Lua function that will let me search this way?</p>