Liquex.Filter.where

You're seeing just the function where, go back to Liquex.Filter module for more information.

Creates an array including only the objects with a given truthy property value

Examples

iex> Liquex.Filter.where([%{"b" => true, "value" => 1}, %{"b" => 1, "value" => 2}, %{"b" => false, "value" => 3}], "b", %{})
[%{"b" => true, "value" => 1}, %{"b" => 1, "value" => 2}]
Link to this function

where(list, key, value, _)

View Source

Creates an array including only the objects with a given property value, or any truthy value by default.

Examples

iex> Liquex.Filter.where([%{"b" => 2}, %{"b" => 1}], "b", 1, %{})
[%{"b" => 1}]