Skip to content

Instantly share code, notes, and snippets.

@nietaki
Created October 15, 2019 21:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nietaki/ee667bd5dcc8124d5947f229cee22fdb to your computer and use it in GitHub Desktop.
Save nietaki/ee667bd5dcc8124d5947f229cee22fdb to your computer and use it in GitHub Desktop.
alias BlogExample.Schema.Comment
import Ecto.Query, only: [from: 2]
query =
from(c in Comment,
where: c.user_id == ^charlie_id
)
comments_by_charlie = Repo.all(query)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment