Deleted User
11/17/2021, 9:44 AMSELECT
s.*,
p
FROM service s
CROSS JOIN LATERAL json_array_elements(pets) p
WHERE p->>'type' == 'dog'
returns an error:
function json_array_elements(json[]) does not exist
Any idea?
The column is a json[] datatype and the data instead is
[
{
"type": "cat",
"price": 10
},
{
"type": "dog",
"price": 20
}
]
I've read the official documentation about JSON data https://supabase.io/docs/guides/database/json - but there is no mention of an array of objects.tourdownunder
11/18/2021, 6:24 PMjson_array_elements(unnest(pets))