从Jolt中删除Group数组元素字段。

huangapple go评论51阅读模式
英文:

Remove Group array element field from Jolt

问题

I have this group array element in my jolt spec called "data", but I want it removed from my spec.

[
  {
    "data": [
      {
        "integrationEntities": {
          "integrationEntity": [
            {
              "integrationEntityHeader": {
                "integrationTrackingNumber": "gut.govan@my.com_666886_20230525163038"
              }
            }
          ]
        }
      }
    ]
  }
]
英文:

I have this group array element in my jolt spec called "data",
but I want it removed from my spec.

[
  {
    "data": [
      {
        "integrationEntities": {
          "integrationEntity": [
            {
              "integrationEntityHeader": {
                "integrationTrackingNumber": "gut.govan@my.com_666886_20230525163038"
              }
            }
          ]
        }
      }
    ]
  }
]

答案1

得分: 2

然后,您应该在保留 data 数组的层级上调整匹配 "data":""删除转换规范,例如:

[
  {
    "operation": "remove",
    "spec": {
      "*": {
        "data": ""
      }
    }
  }
]
英文:

Then you should adjust the match "data":"" within a remove transformation spec at the level where data array stays such as

[
  {
    "operation": "remove",
    "spec": {
      "*": {
        "data": ""
      }
    }
  }
]

huangapple
  • 本文由 发表于 2023年5月30日 03:44:02
  • 转载请务必保留本文链接:https://go.coder-hub.com/76359973.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定