PostgreSQL - JSON and JSONB
Given the table items with a JSONB column attributes, what will this query return?
SELECT id FROM items WHERE attributes @> '{"color": "red"}'::jsonb;Assuming items contains:
id | attributes
---+-------------------------
1 | {"color": "red", "size": "M"}
2 | {"color": "blue", "size": "L"}
3 | {"color": "red"}
4 | {"size": "S"}