Jsonb seems great but I can't figure out how to perform a partial search (like) over an array. In my case it's an array of email:
["firstname.lastname@example.org", "email@example.com", "firstname.lastname@example.org"]
I want to be able to get a record that has an email like "email2".
I tried the following
SELECT * FROM users WHERE jsonb_array_elements(emails) like 'email2';
But it does not work (obviously).
If somebody can help… Thanks!