Query JSONB column where object contains {"active": true}.
Ready — edit the code above and click Run.
SELECT id, data->>'city' AS city
FROM profiles
WHERE data @> '{"active": true}'::jsonb;
Try solving on your own first, then reveal the official answer.
@> checks JSON containment; ->> extracts text field.