EDIT: The key names are dynamic and unknown.
I want to take an Object and create an String array that has each key and value concated together.
My keys contain underscores which I need to get rid of (I have that part working). I'm struggling to figure out the next step to join everything together. (I guess I'm missing how to reference key and value from RHS?)
Input:
{
"object": {
"key_1": [
"A",
"B"
],
"key_2": [
"C"
],
"key_3": [
"D",
"E",
"F"
]
}
}
Desired Output:
{
"results": [
"key 1: A B",
"key 2: C",
"key 3: D E F"
]
}
Spec:
[
{
"operation": "shift",
"spec": {
"object": {
"*_*": "results.&(0,1) &(0,2)",
"*": "results.&"
}
}
}
]
Current spec output:
{
"results": {
"key 1": [
"A",
"B"
],
"key 2": [
"C"
],
"key 3": [
"D",
"E",
"F"
]
}
}
