How to query a JSONB array field using Postgres contains and Elixir’s Ecto library

Avery Duffin
2 min readDec 11, 2020

Lessons learned the hard way

Wow, this took me way too long to figure out. For the past week, I've been stumped by something that was so simple it was complicated. Oh, the pains of learning a new language. Sometimes I feel like the goat pictured above wrapped in a leash of Elixir and Ecto docs. I thought it would be helpful…

--

--

Avery Duffin

Im a software engineer, react developer, inventor, salesman, family man, religious, and outdoor connoisseur