Expand
Expand processes values by creating new objects from objects in arrays.
Interpretation Methods
The processor supports these interpretation methods:
- object
- data
Use Cases
Expanding Data Arrays
If the value is a data array, then the result is:
[{"a":"b"},{"c":"d"}]
{"a":"b"}
{"c":"d"}
Expanding Object Arrays
If the value is an object array, then the result is:
{"a":[{"b":"c"},{"d":"e"}],"x":"y"}
{"b":"c","x":"y"}
{"d":"e","x":"y"}
Expanding Object Arrays in Complex Objects
If the value is part of a complex object, then it can be optionally expanded into paths within the newly created object using the set_key
option. In this example, set_key
== x.y
:
{
"a": {
"b": {
"c": [{
"d": "e"
}],
"h": {
"i": 1
}
}
},
"j": {
"k": 1
}
}
{
"a": {
"b": {
"h": {
"i": 1
}
}
},
"j": {
"k": 1
},
"x": {
"y": {
"d": "e"
}
}
}
Updated over 1 year ago