FatEcto.Dynamics.FatNotDynamics (FatEcto v1.1.0)

View Source

Builds a where query using dynamics and not condition.

Parameters

  • queryable - Ecto Queryable that represents your schema name, table name or query.
  • query_opts - Where query options as a map.

Examples

iex> result = Elixir.FatEcto.Dynamics.FatNotDynamics.not_field_is_nil_dynamic(:location) iex> inspect(result) "dynamic([c], not is_nil(c.location))"

Options

  • $select - Select the fields from hospital and rooms.
  • $where - Added the where attribute in the query.

Summary

Functions

Builds a dynamic query where field is equal to the value.

Builds a dynamic query where value is not between the provided attributes.

Builds a dynamic query where value is not equal and between the provided attributes.

Builds a dynamic query when value of jsonb not matches with any list attribute.

Builds a dynamic query when value of jsonb field is not in the list.

Builds a dynamic query where field is not equal to the value.

Builds a dynamic query where field is not nil.

Builds a dynamic query where field is not greater than the value.

Builds a dynamic query where field is not greater than or equal to the value.

Builds a dynamic query where field not matches the value substring.

Builds a dynamic query where value is not in the the list attributes.

Builds a dynamic query where field not matches the value substring.

Builds a dynamic query where field is not less than the value.

Builds a dynamic query where field is not less than or equal to the value.

Functions

eq_dynamic(key, value, opts \\ [])

@spec eq_dynamic(any(), any(), nil | keyword() | map()) :: Ecto.Query.dynamic_expr()

Builds a dynamic query where field is equal to the value.

Parameters

  • key - Field name.
  • value - Value of the field.
  • opts - Options related to query bindings

Examples

 iex> result = Elixir.FatEcto.Dynamics.FatNotDynamics.eq_dynamic(:experience_years, 2)
 iex> inspect(result)
 "dynamic([q], q.experience_years == ^2)"

not_between_dynamic(key, values, opts \\ [])

@spec not_between_dynamic(any(), any(), nil | keyword() | map()) ::
  Ecto.Query.dynamic_expr()

Builds a dynamic query where value is not between the provided attributes.

Parameters

  • key - Field name.
  • value - Values of the field as a list.
  • opts - Options related to query bindings

Examples

iex> result = Elixir.FatEcto.Dynamics.FatNotDynamics.not_between_dynamic(:experience_years, [2, 5])
iex> inspect(result)
"dynamic([q], q.experience_years < ^2 or q.experience_years > ^5)"

not_between_equal_dynamic(key, values, opts \\ [])

@spec not_between_equal_dynamic(any(), any(), nil | keyword() | map()) ::
  Ecto.Query.dynamic_expr()

Builds a dynamic query where value is not equal and between the provided attributes.

Parameters

  • key - Field name.
  • value - Values of the field as a list.
  • opts - Options related to query bindings

Examples

iex> result = Elixir.FatEcto.Dynamics.FatNotDynamics.not_between_equal_dynamic(:experience_years, [2, 5])
iex> inspect(result)
"dynamic([q], q.experience_years <= ^2 or q.experience_years >= ^5)"

not_contains_any_dynamic(key, values, opts \\ [])

@spec not_contains_any_dynamic(any(), any(), nil | keyword() | map()) ::
  Ecto.Query.dynamic_expr()

Builds a dynamic query when value of jsonb not matches with any list attribute.

Parameters

  • key - Field name.
  • values - values of jsonb field.
  • opts - Options related to query bindings

not_contains_dynamic(key, values, opts \\ [])

@spec not_contains_dynamic(any(), any(), nil | keyword() | map()) ::
  Ecto.Query.dynamic_expr()

Builds a dynamic query when value of jsonb field is not in the list.

Parameters

  • key - Field name.
  • values - values of jsonb field.
  • opts - Options related to query bindings

not_eq_dynamic(key, value, opts \\ [])

@spec not_eq_dynamic(any(), any(), nil | keyword() | map()) ::
  Ecto.Query.dynamic_expr()

Builds a dynamic query where field is not equal to the value.

Parameters

  • key - Field name.
  • value - Value of the field.
  • opts - Options related to query bindings

Examples

 iex> result = Elixir.FatEcto.Dynamics.FatNotDynamics.not_eq_dynamic(:experience_years, 2)
 iex> inspect(result)
 "dynamic([q], q.experience_years != ^2)"

not_field_is_nil_dynamic(key, opts \\ [])

@spec not_field_is_nil_dynamic(any(), nil | keyword() | map()) ::
  Ecto.Query.dynamic_expr()

Builds a dynamic query where field is not nil.

Parameters

  • key - Field name .
  • opts - Options related to query bindings

Examples

iex> result = Elixir.FatEcto.Dynamics.FatNotDynamics.not_field_is_nil_dynamic(:location)
iex> inspect(result)
"dynamic([c], not is_nil(c.location))"

not_gt_dynamic(key, value, opts \\ [])

@spec not_gt_dynamic(any(), any(), nil | keyword() | map()) ::
  Ecto.Query.dynamic_expr()

Builds a dynamic query where field is not greater than the value.

Parameters

  • key - Field name.
  • value - Value of the field.
  • opts - Options related to query bindings

Examples

iex> result = Elixir.FatEcto.Dynamics.FatNotDynamics.not_gt_dynamic(:experience_years, 2, [binding: :last])
iex> inspect(result)
"dynamic([_, ..., c], c.experience_years < ^2)"

not_gte_dynamic(key, value, opts \\ [])

@spec not_gte_dynamic(any(), any(), nil | keyword() | map()) ::
  Ecto.Query.dynamic_expr()

Builds a dynamic query where field is not greater than or equal to the value.

Parameters

  • key - Field name.
  • value - Value of the field.
  • opts - Options related to query bindings

Examples

iex> result = Elixir.FatEcto.Dynamics.FatNotDynamics.not_gte_dynamic(:experience_years, 2, [binding: :last])
iex> inspect(result)
"dynamic([_, ..., c], c.experience_years < ^2)"

not_ilike_dynamic(key, value, opts \\ [])

@spec not_ilike_dynamic(any(), any(), nil | keyword() | map()) ::
  Ecto.Query.dynamic_expr()

Builds a dynamic query where field not matches the value substring.

Parameters

  • key - Field name.
  • value - Value of the field.
  • opts - Options related to query bindings

not_in_dynamic(key, values, opts \\ [])

@spec not_in_dynamic(any(), any(), nil | keyword() | map()) ::
  Ecto.Query.dynamic_expr()

Builds a dynamic query where value is not in the the list attributes.

Parameters

  • key - Field name.
  • values - Pass a list of values of the field that represent range.
  • opts - Options related to query bindings

Examples

iex> result = Elixir.FatEcto.Dynamics.FatNotDynamics.not_in_dynamic(:experience_years, [2, 5])
iex> inspect(result)
"dynamic([q], q.experience_years not in ^[2, 5])"

not_like_dynamic(key, value, opts \\ [])

@spec not_like_dynamic(any(), any(), nil | keyword() | map()) ::
  Ecto.Query.dynamic_expr()

Builds a dynamic query where field not matches the value substring.

Parameters

  • key - Field name.
  • value - Value of the field.
  • opts - Options related to query bindings

not_lt_dynamic(key, value, opts \\ [])

@spec not_lt_dynamic(any(), any(), nil | keyword() | map()) ::
  Ecto.Query.dynamic_expr()

Builds a dynamic query where field is not less than the value.

Parameters

  • key - Field name.
  • value - Value of the field.
  • opts - Options related to query bindings

Examples

iex> result = Elixir.FatEcto.Dynamics.FatNotDynamics.not_lt_dynamic(:experience_years, 2, [binding: :last])
iex> inspect(result)
"dynamic([_, ..., c], c.experience_years > ^2)"

not_lte_dynamic(key, value, opts \\ [])

@spec not_lte_dynamic(any(), any(), nil | keyword() | map()) ::
  Ecto.Query.dynamic_expr()

Builds a dynamic query where field is not less than or equal to the value.

Parameters

  • key - Field name.
  • value - Value of the field.
  • opts - Options related to query bindings

Examples

iex> result = Elixir.FatEcto.Dynamics.FatNotDynamics.not_lte_dynamic(:experience_years, 2, [binding: :last])
iex> inspect(result)
"dynamic([c], c.experience_years > ^2)"