【问题标题】:Jolt transformation to concat arraysJolt 转换为 concat 数组
【发布时间】:2017-12-20 17:15:36
【问题描述】:

我想使用 jolt 转换来连接两个列表

输入

{
    "listA": [
        1,
        2,
        3
    ],
    "listB": [
        4,
        5
    ]
}

震动规格

[{
    "operation": "shift",
    "spec": {
        "listA": "items",
        "listB": "items"
    }
}]

期望的输出:

{
  "items" : [ 1, 2, 3, 4, 5 ]
}

我得到一个嵌套列表。如何获得所需输出中的平面列表?

【问题讨论】:

    标签: json transformation jolt


    【解决方案1】:
    [
       {
         "operation": "shift",
         "spec": {
           "listA": {
             "*": "items[]"
           },
           "listB": {
             "*": "items[]"
           }
         }
      }
    ]
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-06-28
      • 1970-01-01
      • 1970-01-01
      • 2023-02-06
      • 1970-01-01
      • 2021-09-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多