I am trying to figure out in PostgreSQL 11 JSONB query
SELECT id, my_json_field #>> '{field_depth_1, field_depth_2}'
FROM my_data
WHERE my_json_field @> '{"other_field": 3}'::jsonb
If other_field is a key-value pair, this works perfectly and I get every row with other_field = 3. However, if other_field is a list of values, eg: [2,3,6,8,10], and I want to find out for every row whether the value 3 exists in the list represented by other_field, how should I write the query?