I have a table A with a column b as jsonb
b
------------------
{"c": 1}
{"c": 1, "d": 2}
how to build a query for rows where d is missing?
SELECT * FROM A WHERE b@>'{"c":1}';
returns all rows while
SELECT * FROM A WHERE b@>'{"c":1,"d":null}';
returns none ( due d is not null in first row );