title: Postgres jsonb column select from array where a string matches wildcards
body: <p>I'm looking to use postgres jsonb columns with arrays and being able to filter on them, so I have a schema with a column:</p>
  
  <pre><code>CREATE TABLE testtable
  (
  id  varchar(32) NOT NULL,   
  refs    jsonb           NULL,
  )
  </code></pre>
  
  <p>and the column contains data in the Json format:</p>
  
  <pre><code>{ "refs": ["one-1-0", "two-3-2", "two-3-4" ] }
  </code></pre>
  
  <p>I would like to be able to return all rows that that contain an array element that starts with (for example) "two-3-"</p>
  
  <p>I have tried several things and can not get it to work as I'd like (the closest I have is to get the array part as text and search it as a string - but this is nasty)</p>
  
  <p>I would also like to add a suitable index to this column to support this query.</p>
  
  <p>Any suggestions would be briliant and greatfully received!
  Thanks</p>