-
Here's some ways I found with mlr 6.9 to move all properties of a JSON object up one level - the parent field is Input {
"oldtop": {
"child_0": {
"child_00": {
"child_000": "child_000 value",
"child_001": 123
},
"child_01": [
{
"child_010": "child_010 value 0",
"child_011": 231
},
{
"child_010": "child_010 value 1",
"child_011": 312
}
]
},
"child_1": "child_1 value",
"child_2": 987
}
} Output {
"child_0": {
"child_00": {
"child_000": "child_000 value",
"child_001": 123
},
"child_01": [
{
"child_010": "child_010 value 0",
"child_011": 231
},
{
"child_010": "child_010 value 1",
"child_011": 312
}
]
},
"child_1": "child_1 value",
"child_2": 987
} These 3 methods work as long as properties of
What if
Method 4 gives {
"child_0_merged": {
"child_0_oldtop": {
"child_00": {
"child_000": "child_000 value",
"child_001": 123
},
"child_01": [
{
"child_010": "child_010 value 0",
"child_011": 231
},
{
"child_010": "child_010 value 1",
"child_011": 312
}
]
},
"child_0_root": "child_0 top value"
},
"child_1": "child_1 value",
"child_2": 987
} |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
@zmajeed This is nice!! 😎 |
Beta Was this translation helpful? Give feedback.
-
Thank you very much @zmajeed |
Beta Was this translation helpful? Give feedback.
@zmajeed This is nice!! 😎