如何使用JOLT将整个JSON对象作为值映射到新的JSON键?
我的目标是将JSON对象映射为新JSON对象键中的as值。例如: 我的起始JSON:如何使用JOLT将整个JSON对象作为值映射到新的JSON键?,json,jolt,Json,Jolt,我的目标是将JSON对象映射为新JSON对象键中的as值。例如: 我的起始JSON: { "old_key_1" : "some_json_structure_1", "old_key_2" : "some_json_structure_2", "old_key_3" : "some_json_structure_3" } 我的目标是: { "new_key_1" : { "old_key_1" : "some_json_structure_1", "old_ke
{
"old_key_1" : "some_json_structure_1",
"old_key_2" : "some_json_structure_2",
"old_key_3" : "some_json_structure_3"
}
我的目标是:
{
"new_key_1" :
{
"old_key_1" : "some_json_structure_1",
"old_key_2" : "some_json_structure_2",
"old_key_3" : "some_json_structure_3"
}
}
使用JOLT怎么可能:如果我理解得很好,我必须使用shift规范,但我不理解如何使用
有人能帮我吗
提前感谢您包装到新对象中:
[
{
"operation": "shift",
"spec": {
"*": {
"@": "new_key_1.&" //the "&" means go up the tree 0 levels, grab what is there and subtitute it in
}
}
}
]
谢谢@Magda。它起作用了:我以前得到过这个解决方案,但我忘了把解决方案放在问题中。所以,谢谢你为我做这件事,谢谢你的解决方案!