Map Op
This operation maps result from evaluated result expression into a key-value list.
Definition: ["map", <key: string, expression(string)>, <value: string, expression(string)>, <result: expression(array)>]
- <key: string, expression(string)> - Specifies a key to be used in key-value result.
- <value: string, expression(string)> - Specifies a value to be used in key-value result.
- <result: expression(array)> - Expression to be evaluated from which the key-value list will be created.
Usage
Request:
["map", "name", "age", ["value", [
{"name": "john", "age": 22},
{"name": "mark", "age": 15}
]]]
Response:
{
"john": 22,
"mark": 15
}
Typical Usage
You can use this operation in conjunction with other expression to result key-value lists which you can use in applications for filtering, validation or just list showing.