title: How to search in an array that is in a json?
body: <p>I am trying to make a query to a json, the problem is when the search is performed in an array, if it is a property of the json that is not an array, it performs the search correctly, I want to be able to do it with 'where' only.</p>
  <p>I have this:</p>
  <pre><code>$query-&gt;where('json_schema-&gt;lastYear-&gt;[0]-&gt;rate', '=', 100);
  </code></pre>
  <p>but it can't find it and if I do this:</p>
  <pre><code>$query-&gt;where('json_schema-&gt;name', '=', 'Test');
  </code></pre>
  <p>effectively it returns the record with <code>name</code> 'Test' but when looking in the array is where it does not do it</p>
  <p>I don't want to use <code>whereJsonContains</code></p>
  <p>my json_schema:</p>
  <pre><code>{
    &quot;name&quot;: 'Test',
    &quot;lastYear&quot;: [
      {
       &quot;rate&quot;:100,
       &quot;premium&quot;:200
      },
      {
       &quot;rate&quot;:300,
       &quot;premium&quot;:400
      }
    ]
  }
  </code></pre>
  <p>I tried:</p>
  <pre><code>$jsonValue = 'json_schema-&gt;lastYear-&gt;&quot;$[*].rate&quot;';
  $result = $query-&gt;where($jsonValue,&quot;=&quot;,&quot;100&quot;);
  </code></pre>
  <p>when performing <code>toSql()</code> I receive:</p>
  <pre><code>select * from `iquote` where json_unquote(json_extract(`json_schema`, '$.&quot;lossExperience&quot;.&quot;rateChange&quot;.&quot;generalLiability&quot;.&quot;lastYear&quot;.&quot;&quot;$[*].rate&quot;&quot;')) = ?
  </code></pre>