Array
Array transforms operate on JSON arrays.
array.join
Transforms a JSON array by joining the values into a string.
["b","c","d"]
b.c.d
Settings
Field | Type | Description | Required |
---|---|---|---|
object.source_key | string | Retrieves a value from an object for transformation. | No |
object.target_key | string | Places a value into an object after transformation. | No |
separator | string | Separator substring that is used to join values. | Yes |
Example
sub.transform.array.join(
settings={separator: '.'}
)
sub.tf.arr.join({separator: '.'})
array.zip
Transforms JSON arrays by reindexing values into an array of arrays or array of objects.
{"a":[["b","c"],[1,2]]}
{"a":[["b",1],["c",2]]}
Settings
Field | Type | Description | Required |
---|---|---|---|
object.source_key | string | Retrieves a value from an object for transformation. | Yes |
object.target_key | string | Places a value into an object after transformation. | Yes |
Example
sub.transform.array.zip(
settings={object: {source_key: 'arr', target_key: 'arr'}}
)
sub.tf.arr.zip({obj: {src: 'arr', trg: 'arr'}})
Updated 9 months ago