MAPFILTER
Filters a map for specific items.
There are two variants of this function that work differently
Parameters
Order | Name | Type | Desc |
---|---|---|---|
1 | original | map | The map to be filtered |
2 | filterkey | const | The name of the map item to be searched for |
3 | filtervalue | const | The value of the map item to allow |
or
Returns
Places an map on the stack.
Description
This function filters the map (original).
If using the three-parameter version, any item that does not contain the specified filterkey and filtervalue will be removed.
If using the two-parameter version, any item that does not contain each of the map keys and values found in filterkey will be removed.
For example, if you had the following map in your stack…
[ { "name": "alpha", "colour": "orange", "style": "plain" }, { "name": "beta", "colour":"blue", "style":"exotic"} ]
…then the command 'colour' 'blue' MAPFILTER will remove 'alpha' from your map, leaving only 'beta'.