Removes all null, empty, and invalid (is_valid == false, empty lists, etc..) objects from the list.
compact
Use the compact filter to remove null, empty, and invalid items from a list (e.g. for cleaner iteration or mapping).
How to use the compact filter
CopyRemove null and empty from a list
After map or other operations
When the list may contain invalid items
Adds all of the items from the other list onto the end of the input list.
concat: list other
If either the input or other is not a list, it will be treated as a list with a single object. If either is null, it will be treated as an empty list.
Returns the first item in the input list
first
If the input is not a list, it will be returned without modification.
Groups the list by the given property and returns the results as a list of objects. Each object in the result set has a Key property which is the value that they are grouped by and a Value property which is the list of objects that have the matching Key property. Any objects in the list that do not have the given property will be in a result with a null Key.
group_by: String property
If the input is null it will return an empty list. If the input is not null and is not a list, it will be treated as a list with a single object.
{{ group_field }}
Returns the 0-based index of the first occurrence of find in the current list or string, or -1 if it cannot be found. If start is greater than 0, the search will begin at the specified index.
index: object findInteger startBoolean ignorecase
If the input is a string, will search for the index of find as a string in the input. If the input is a list, will search for the index of find in the list. If the input is neither a list or an object, the index filter will return 0 if find is the same as the input or -1 if it is not the same.
Returns the 0-based location of the find string in the current string, or -1 if it cannot be found. If start is greater than 0, the search will begin at the specified index. To ignore capitalization, set ignorecase to true.
index: String findInteger startBoolean ignorecase
Returns a string with each element from the input list joined together with the glue string between elements.
join
If the input is not a list, it will be treated as a list with a single object. If either is null, it will be treated as an empty list. All objects in the list will be converted to a string using their default string output if they are not already strings.
Return a new list with the given property from every object in the input list.
map: String property
If the input is null, it will be treated as an empty list. If it is not null and not a list, it will be treated as a list with a single object.
{% map %}
Returns a random value. Can behave differently depending on both the type of input and on the arguments supplied. Unless prevent_cache is false, the rand filter will prevent the page from being fast-cached. Note: the rand filter should NOT be considered cryptographically secure - do not use in places where cryptographic security is a requirement (ie: do not use to generate random passwords).
rand: Integer lengthBoolean allow_repeatsBoolean prevent_cache
This filter behaves differently depending on the type of input supplied:
Number - If the input is an integer and length is 1, returns a new integer between 1 and the input value. If the input is an integer and length is greater than 1, returns a new list of length numbers between 1 and the input value. If allow_repeats is false, the list returned will be unique. This may result in a list with fewer than length items if the input is less than length.
String - If the input is a string, returns a new random string with length characters, where each character comes directly from the input. If allow_repeats is false, no characters from the input will be used more than once (although any character repeated in the input may be repeated up to the same number of times in the resulting string) - which may result in a string shorter than length if the input string is shorter than length.
List - If the input is a list or list-like object and length is 1, returns a random object from the list. If the input is a list or list-like object and length is greater than 1, returns a new random list of length items from the input list. If allow_repeats is false, no items from the input will be used more than once (although any repeated items in the input may be repeated up to the same number of times in the resulting list) - which may result in a list with fewer than length items if the input list has fewer than length items.
Returns the length of the input string or list.
size
If the input is not a string or list returns 0.
Remove all duplicate objects in the input list. If property is specified, objects are considered duplicate if their property value is the same.
uniq: String propertyBoolean ignorecase
If the input is null it will return an empty list. If the input is not null and is not a list, it will be treated as a list with a single object.
Returns the last item in the input list
last
If the input is not a list, it will be returned without modification.
Returns the last 0-based location of the last occurrence of find string in the current string, or -1 if it cannot be found. If start is greater than or equal to 0, the search will begin at the specified index. To ignore capitalization, set ignorecase to true.
last_index: String findInteger startBoolean ignorecase
Returns the 0-based index of the last occurrence of find object in the current list or string, or -1 if it cannot be found. If start is greater than -1, the search will begin at the specified index.
last_index: object findInteger startBoolean ignorecase
If the input is a string, will search for the last index of find as a string in the input. If the input is a list, will search for the last index of find in the list. If the input is neither a list or an object, the index filter will return 0 if find is the same as the input or -1 if it is not the same.
Reverses the input string or list.
reverse
When used with a string as input, the result is a string. Otherwise the result is a list.
Sorts the input list randomly. Unless prevent_cache is false, the shuffle filter will prevent the page from being fast-cached.
shuffle: Boolean prevent_cache
If the input is null it will return an empty list. If the input is not null and is not a list, it will be treated as a list with a single object.
Return a part of the current string or list.
slice: Integer startInteger length
If the input is a string this will return a string. If it is a list it will return a list. Otherwise it will not do anything and will return the unaltered input.
Sort objects in the input list. If the property is specified, use it to sort objects in the list. Use the special string value "random" to sort the list in a random order - which is functionally identical to using the shuffle filter.
sort: String propertyBoolean ignorecase
If the input is null it will return an empty list. If the input is not null and is not a list, it will be treated as a list with a single object.
Sort objects in the input list. If the property is specified, use it to sort objects in the list. Use the special string value "random" to sort the list in a random order - which is functionally identical to using the shuffle filter. The sort_natural filter ignores capitalization while the sort filter does not by default. For readability and consistency, it is advised to use the sort filter with the ignorecase property set to true instead of the sort_natural filter.
sort_natural: String property
If the input is null it will return an empty list. If the input is not null and is not a list, it will be treated as a list with a single object.
Multiply the input by the operand.
times: Number operand
This filter currently behaves differently if the input is a string and the operand is an integer. In that case the result is a list of strings with input repeated operand times.
{{ time }}
Split a string into a list of substrings separated by the given separator
split: String separator
Returns a new list which only contains items from the input list where the property has the specified value.
where: String propertyobject valueBoolean ignorecase
If the input is null it will return an empty list. If the input is not null and is not a list, it will be treated as a list with a single object. If the property to filter by is null, the input list will be unfiltered.
Returns a new list which only contains items from the input list that match the given expression when the item is referenced as name.
where_exp: String nameString expression
If the input is null it will return an empty list. If the input is not null and is not a list, it will be treated as a list with a single object. If either name or expression are null or empty, the input list will be unfiltered.