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

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

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.

  1. [
  2. {
  3. "data": [
  4. {
  5. "integrationEntities": {
  6. "integrationEntity": [
  7. {
  8. "integrationEntityHeader": {
  9. "integrationTrackingNumber": "gut.govan@my.com_666886_20230525163038"
  10. }
  11. }
  12. ]
  13. }
  14. }
  15. ]
  16. }
  17. ]
英文:

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

  1. [
  2. {
  3. "data": [
  4. {
  5. "integrationEntities": {
  6. "integrationEntity": [
  7. {
  8. "integrationEntityHeader": {
  9. "integrationTrackingNumber": "gut.govan@my.com_666886_20230525163038"
  10. }
  11. }
  12. ]
  13. }
  14. }
  15. ]
  16. }
  17. ]

答案1

得分: 2

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

  1. [
  2. {
  3. "operation": "remove",
  4. "spec": {
  5. "*": {
  6. "data": ""
  7. }
  8. }
  9. }
  10. ]
英文:

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

  1. [
  2. {
  3. "operation": "remove",
  4. "spec": {
  5. "*": {
  6. "data": ""
  7. }
  8. }
  9. }
  10. ]

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:

确定