JSON路径未过滤嵌套集合

问题描述

我是JSON的新手,我想问问如何根据子元素/列过滤嵌套的集合? 我试图这样写,但是不起作用:

$ .. []。contracts [?($ .. []。assignments []。ContractId == $ .. []。contracts [*] .ContractId)]

我想获取与ContractId字段的工作分配集合相匹配的合同集合。

谢谢您的帮助!

{
  "items" : [ {
    "PersonId" : 1000,"PersonNumber" : "123456","CorrespondenceLanguage" : null,"BloodType" : null,"DateOfBirth" : "1965-12-13","DateOfDeath" : null,"CountryOfBirth" : "XX","RegionOfBirth" : null,"TownOfBirth" : "Londek","ApplicantNumber" : "000","CreatedBy" : "sss","CreationDate" : "2018-12-11T05:39:50.279+00:00","LastUpdatedBy" : "xxx","LastUpdateDate" : "2020-08-18T15:10:50.167+00:00","workRelationships" : [ {
      "PeriodofServiceId" : 1,"contracts" : [ {
        "ContractId" : 11,"links" : [ ]
      } ],"assignments" : [ {
        "ContractId" : 12,"links" : [ ]
    },{
      "PeriodofServiceId" : 2,"contracts" : [ {
        "ContractId" : 12,"links" : [  ]
      } ],"assignments" : [ {
        "ContractId" : 11,"links" : [ ]
    } ],"links" : [ ]
  } ],"count" : 1,"hasMore" : false,"limit" : 25,"offset" : 0,"links" : [ ]
}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)