Function minijinja::filters::unique

source ·
pub fn unique(values: Vec<Value>) -> Value
Available on crate feature builtins only.
Expand description

Returns a list of unique items from the given iterable.

Returns a list of unique items from the given iterable.

{{ ['foo', 'bar', 'foobar', 'FooBar']|unique|list }}
  -> ['foo', 'bar', 'foobar']

The unique items are yielded in the same order as their first occurrence in the iterable passed to the filter. The filter will not detect duplicate objects or arrays, only primitives such as strings or numbers.