PostgreSQL JSONB: How to get an element from Array of Embedded Documents
SELECT ($${
   "_id": 100,
   "type": "food",
   "item": "xyz",
   "qty": 25,
   "price": 2.5,
   "ratings": [ 5, 8, 9 ],
   "memos": [ { "memo": "on time", "by": "shipping" }, { "memo": "approved", "by": "billing" } ]
}$$::jsonb)@&gt;'{"memos":[{"by":"shipping"}]}';
 ?column? 
----------
 t


Note that that only works with jsonb.

You'll probably find the documentation on json indexing useful too.