我正在尝试使用array合并一个标签数组。
这是输入和预期输出
输入JSON:
{
"students": [
{
"student_name": "Xavier"
},
{
"student_name": "moses"
},
{
"student_name": "joseph"
}
]
}预期产出如下
{
"students": {
"student_name": "Xavier,moses,joseph"
}
}提前谢谢!
发布于 2022-03-09 18:01:00
您可以使用这些连续的规范。
[
// create a list to combine all student names nested within "students" object
{
"operation": "shift",
"spec": {
"students": {
"*": {
"*": "&2.&"
}
}
}
},
// concatenate all members of the list at once by using "join"
{
"operation": "modify-overwrite-beta",
"spec": {
"students": {
"*": "=join(',',@(1,&))"
}
}
}
]http://jolt-demo.appspot.com/站点上的演示

https://stackoverflow.com/questions/71413109
复制相似问题