mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-24 00:47:57 -05:00
25 lines
849 B
Plaintext
25 lines
849 B
Plaintext
{
|
|
"name": "array_foreach",
|
|
"type": "function",
|
|
"groups": ["Arrays"],
|
|
"description": "Returns an array with the given expression evaluated on each item.",
|
|
"arguments": [{
|
|
"arg": "array",
|
|
"description": "an array"
|
|
}, {
|
|
"arg": "expression",
|
|
"description": "an expression to evaluate on each item. The variable `@element` will be replaced by the current value and the variable `@counter` by the current index (starting with 0)."
|
|
}],
|
|
"examples": [{
|
|
"expression": "array_foreach(array('a','b','c'),upper(@element))",
|
|
"returns": "[ 'A', 'B', 'C' ]"
|
|
}, {
|
|
"expression": "array_foreach(array(1,2,3),@element + 10)",
|
|
"returns": "[ 11, 12, 13 ]"
|
|
}, {
|
|
"expression": "array_foreach(array(1,2,3),@element + @counter)",
|
|
"returns": "[ 1, 3, 5 ]"
|
|
}],
|
|
"tags": ["evaluated", "array", "iterate", "item"]
|
|
}
|