I have installed MySql 8.0.37-0ubuntu0.20.04.3 – (Ubuntu).
I have a table named vendas_pendentes with a field named venda type JSON
I using a query to search for a key named order_reference like this:
<code>select * from vendas_pendentes where venda->"$.data.items[*].order_reference" ='171972786245566'
</code>
<code>select * from vendas_pendentes where venda->"$.data.items[*].order_reference" ='171972786245566'
</code>
select * from vendas_pendentes where venda->"$.data.items[*].order_reference" ='171972786245566'
And it returns nothing, but when I replace [*] for [102] I get the line.
I am new to the json field in mysql. How can I query the database without knowing the “index number” inside items?
Many thanks!