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 average of values in 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 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 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 |
condition | str | (optional) expression to determine if item from the first list should be included in final list (return true to include, false to exclude; use '$left' and '$right' to refer to the current item from the first and seconds lists respectively; default: equality condition) |
Find the last index position of the given value.
Name | Type | Description |
---|---|---|
list | list | list value |
value | any | value to check for |
Get largest value in list.
Name | Type | Description |
---|---|---|
list | list | list value |
expression | str | (optional) expression to fetch value (use '$' to refer to the current item; default: $) |
Get smallest value in 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 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 appendending " ascending" or " descending" to the key(s); when omitted, the direction is asending by default |
Get a random item from the list.
Name | Type | Description |
---|---|---|
list | list | list value |
Combine all values in 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 |
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) |
compare | str | (optional) compare two items (return -1 if left item less than the right item, 0 if they are equal, and +1 if the left item is greater than the right item; use '$left' and '$right' to refer to the left and right items respectively) |
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 sum of values in list.
Name | Type | Description |
---|---|---|
list | list | list value |
expression | str | (optional) expression to fetch value (use '$' to refer to the current item; default: $) |