Okay, figured it out:
Instead of using Jason.encode, use type/2 with :map:
intern = %{"Employment Type" => "Intern"}
insert(:job, custom_fields: intern)
query =
from j in Job,
as: :job,
where: fragment("custom_fields @> ?::jsonb", type(^intern, :map)),
select: j.id
Thanks!






















