Querying Postgres 9.6 JSONB array of objects
问题 I have the following table: CREATE TABLE trip ( id SERIAL PRIMARY KEY , gps_data_json jsonb NOT NULL ); The JSON in gps_data_json contains an array of of trip objects with the following fields (sample data below): mode timestamp latitude longitude I'm trying to get all rows that contain a certain "mode". SELECT * FROM trip where gps_data_json ->> 'mode' = 'WALK'; I pretty sure I'm using the ->> operator wrong, but I'm unsure who to tell the query that the JSONB field is an array of objects?