I have a jsonb field type in a table, it contains the JArray:
[
{
"code": "F01",
"name": "Apple"
},
{
"code": "F02",
"name": "Orange"
},
{
"code": "F03",
"name": "Banana"
}
]
I try to query based on the code and expecting the name like below:
select a.myarray name from fruits a where a.myarray ->> 'code' = 'F02'
but it returns empty
What I missed?