摇动-转换数据并使用值过滤内部数组

问题描述

我需要解决一个困难的震动。有人可以帮忙吗?

{
  "results": {
    "data": [
      {
        "name": "xx","typeRelationship": [
          {
            "relationship": "parent","type": {                
              "id": "yyyyy",}
          }
        ],"id": "xxxxxxxx"
      },{
        "name": "yy","typeRelationship": [
          {
            "relationshipType": "parent","type": {
              "id": "CCCC"
            }
          },{
            "relationshipType": "child","service": {
              "id": "dddd"
            }
          },"service": {
              "id": "xxxxxxxx"
            }
          }
        ],"id": "yyyyy"
      }
    ]
  }
}

我需要做的就是根据这种情况进行过滤的JOLT: results.data.typeRelationship.type.id = xxxxxxxx

所以结果应该过滤并显示出来:

{
  "rows" : [  {
    "rowdata" : {
      "relationshipType" : "child","Name" : "yy","id" : "yyyyy"
    }
  } ]
}

解决方法

这有效,

[
  {
    "operation": "shift","spec": {
      "results": {
        "data": {
          "*": {
            "typeRelationship": {
              "*": {
                "type|service": {
                  "id": {
                    "xxxxxxxx": {
                      "@(3,relationshipType)": "rows[&6].rowdata.relationshipType","@(5,name)": "rows[&6].rowdata.Name",id)": "rows[&6].rowdata.id"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
]