title: Postgresql JSON column check key exists
body: <p>I have wrote query like this to check json column has key </p>
  
  <pre><code>SELECT *
  FROM "details" 
  where ("data"-&gt;'country'-&gt;'state'-&gt;&gt;'city') is not null; 
  </code></pre>
  
  <p>but i need to write query which will select row if "data" contains "city" </p>
  
  <p>json structure of data is not consistent.</p>