Object Transformers
Object transformers can be used on a value data type of Array, including dictionaries coming from other transformers, such as by using dot notation on another dictionary. Following transformers are available:
keys
keysReturns Array with all keys of the source dictionary.
Usage:
.keys()Example usage:
dictionary.keys()Example return:
["bob": "ferrari", "dan": "lada"]to["bob", "dan"]
values
valuesReturns Array with all values of the source dictionary.
Usage:
.values()Example usage:
dictionary.values()Example return:
["bob": "ferrari", "dan": "lada"]to["ferrari", "lada"]
add
addReturns copy of the source dictionary extended by provided key: value. Value can be either plain value or evaluated piece of context.
Usage:
.add(key, value)Example usage:
value.add("Also Bob", self.bob)Example return:
["bob": "ferrari", "dan": "lada"]to["bob": "ferrari", "dan": "lada", "Also Bob": "ferrari"]
count
countReturns the number of key-value pairs in the collection. Note that if the dictionary is nested, it will not count the size of nested elements, only key-value pairs of the root level.
Usage:
.count()Example usage:
dictionary.count()Example return:
["bob": "ferrari", "dan": "lada"]to2
Last updated
Was this helpful?