如何解决摇动-转换数据并使用值过滤内部数组
我需要解决一个困难的震动。有人可以帮忙吗?
{
"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"
}
}
}
}
}
}
}
}
}
}
]
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。