Query for array elements inside JSON type
I'm trying to test out the json type in PostgreSQL 9.3. I have a json column called data in a table called reports . The JSON looks something like this: { "objects": [ {"src":"foo.png"}, {"src":"bar.png"} ], "background":"background.png" } I would like to query the table for all reports that match the 'src' value in the 'objects' array. For example, is it possible to query the DB for all reports that match 'src' = 'foo.png' ? I successfully wrote a query that can match the "background" : SELECT data AS data FROM reports where data->>'background' = 'background.png' But since "objects" has an