I'm having some trouble wrapping my head around querying JSON arrays in postgres. For example:
Given a Postgres table foobar with the JSONB column data like...
db=# select * from foobar;
id | data
----+--------------------------------------------
1 | [[true, true], [true, false]]
2 | [[true, true], [true, true]]
3 | [[true, true], [true, true], [true, true]]
(3 rows)
How would I write a select query that would select only the row which contains only true values in each array in data and whose array is of length 2. (i.e., row id = 2 in the example above)?