Create a new list by applying the expression to each item.
| Name | Type | Description |
|---|---|---|
| list | list | list value |
| expression | str | expression to apply (use '$' to refer to the current item) |
Get the average of the values in a list.
| Name | Type | Description |
|---|---|---|
| list | list | list value |
| expression | str | (optional) expression to fetch value (use '$' to refer to the current item; default: $) |
Collect all values from each map inside the list.
| Name | Type | Description |
|---|---|---|
| list | list | list of maps |
| key | str | key for value to collect |
Combine two lists into a map.
| Name | Type | Description |
|---|---|---|
| keys | list | list of keys |
| values | list | list of values |
Check if a list contains the given value.
| Name | Type | Description |
|---|---|---|
| list | list | list value |
| value | any | value to check for |
| ignorecase | bool | (optional) ignore case (default: false) |
Count the number of items for which the condition succeeds.
| Name | Type | Description |
|---|---|---|
| list | list | list value |
| condition | str | condition to execute for each item (use '$' to refer to the item) |
Group items in a list by common expression value.
| Name | Type | Description |
|---|---|---|
| list | list | list value |
| expression | str | expression to apply for grouping (use '$' to refer to the current item) |
Find all index positions of the given value.
| Name | Type | Description |
|---|---|---|
| list | list | list value |
| value | any | value to check for |
Find the index position of the given value.
| Name | Type | Description |
|---|---|---|
| list | list | list value |
| value | any | value to check for |
Compute the list of values that are common to the first and second list.
| Name | Type | Description |
|---|---|---|
| first | list | first list |
| second | list | second list |
Optional: Use the condition (str) expression to determine if an item from the first list should be included in the final list.
$left and $right to refer to the current item from the first and seconds lists, respectively.Find the last index position of the given value.
| Name | Type | Description |
|---|---|---|
| list | list | list value |
| value | any | value to check for |
Get the largest value in a list.
| Name | Type | Description |
|---|---|---|
| list | list | list value |
| expression | str | (optional) expression to fetch value (use $ to refer to the current item; default: $) |
Get the smallest value in a list.
| Name | Type | Description |
|---|---|---|
| list | list | list value |
| expression | str | (optional) expression to fetch value (use $ to refer to the current item; default: $) |
Create a list of a given size.
| Name | Type | Description |
|---|---|---|
| size | num | size of the list |
| value | any | (optional) intial value for list entry (default: nil) |
Sort items in a list using key names.
| Name | Type | Description |
|---|---|---|
| list | list | list value |
| keys | any | key name or list of key names; sort direction is controlled by adding " ascending" or " descending" to the keys; when omitted, the direction is ascending by default |
Get a random item from the list.
| Name | Type | Description |
|---|---|---|
| list | list | list value |
Combine all values in a list into a single value using the supplied expression.
| Name | Type | Description |
|---|---|---|
| list | list | list value |
| expression | str | expression to compute combined value (use '$value' and '$item' to refer to the current value and item, respectively) |
| value | any | (optional) starting value (default: nil) |
Reverse the items in a list.
| Name | Type | Description |
|---|---|---|
| list | list | list value |
Example:
var lst = ["one","two","three","four","five"]; list.reverse(lst);
Create a list that only contains values for which the condition succeeds.
| Name | Type | Description |
|---|---|---|
| list | list | list value |
| condition | str | condition to execute for each item (use '$' to refer to the item) |
Sort the items in a list.
| Name | Type | Description |
|---|---|---|
| list | list | list of values |
| key | any | (optional) key for value if list contains maps (default: nil) |
| reverse | bool | (optional) sort in reverse order (default: false) |
Optional:
compare (str) to compare two items.$left and $right to refer to the left and right items, respectively.-1 if the left item is less than the right item; 0 if items are equal; +1 if the left item is greater than the right item.Split a list and insert new items into it.
| Name | Type | Description |
|---|---|---|
| list | list | list value |
| start | num | copy all values before the start offset; if negative, offset is relative to end of list |
| length | num | (optional) number of elements to skip; if negative, relative to length of list (default: all) |
| values | list | (optional) values to append after start offset (default: none) |
Example:
var lst = ["one","two","three","four","five"]; list.splice(lst,2);
Get the sum of values in a list.
| Name | Type | Description |
|---|---|---|
| list | list | list value |
| expression | str | (optional) expression to fetch value (use $ to refer to the current item; default: $) |