How to find posts in given List of ids?
This isn't working:
posts = Post |> where(id: [1, 2]) |> Repo.all
Example in Rails:
Post.where({ id: [1, 2]})
# SELECT * FROM posts WHERE id IN (1, 2)
The following should work:
posts = Post |> where([p], p.id in [1, 2]) |> Repo.all