CREATE TABLE example (j JSON);
INSERT INTO example VALUES
('{
"family": "anatidae",
"species": [
{"name": "duck", "animal": true},
{"name": "goose", "animal": true},
{"name": "rock", "animal": false}
]
}'
);
How can I find if duck is one of the species?
It looks like I need to apply an extraction function to an array like:
SELECT 'duck' IN j -> '$.species' ->> 'name' AS is_duck_here FROM example
