How to loop through JSON array of JSON objects to see if it contains a value that I am looking for in postgres?
There is no way around unnesting the array for every row (the drawbacks of de-normalizing data). But you don't need a cross join, an EXISTS condition should work just fine.
select *
from demo d
where exists (select *
              from jsonb_array_elements(d.rawjson) as r(jdoc)
              where (jdoc -&gt;&gt; 'a')::int &lt; 2
                and (jdoc -&gt;&gt; 'b')::int &lt; 8);

If your columns is not a jsonb (which it should be), use json_each() instead
Online example