Skip to main content

min

Function min 

Source
pub fn min(
    state: &State<'_, '_>,
    value: Value,
    kwargs: Kwargs,
) -> Result<Value, Error>
Expand description

Returns the smallest item from an iterable.

The filter accepts a few keyword arguments:

  • case_sensitive: set to true to compare strings case sensitively.
  • attribute: can be set to an attribute or dotted path to compare by that attribute. The whole item is returned.
{{ [1, 2, 3, 4]|min }} -> 1
{{ users|min(attribute="age") }}