Endon.where

You're seeing just the function where, go back to Endon module for more information.
Link to this function

where(conditions, opts \\ [])

View Source

Specs

Fetch all entries that match the given conditions.

The conditions can be a Ecto.Query.t/0 or a Keyword.t/0.

Options

  • :order_by - By default, orders by primary key ascending
  • :preload - A list of fields to preload, much like Ecto.Repo.preload/3
  • :offset - Number to offset by
  • :limit - Limit results to the given count

Examples

iex> User.where(id: 1)
iex> User.where(name: "billy", age: 23)
iex> User.where([name: "billy", age: 23], limit: 10, order_by: [desc: :id])
iex> query = from u in User, where: u.id > 10
iex> User.where(query, limit: 1)