从json中获取来自child的父值

时间:2017-10-25 17:22:49

标签: javascript json jsonpath

我有以下json,我正在尝试根据requestId中的值获得teamId

我正在尝试使用json路径

$.[*].teamAssignments[?(@.teamId == 'Team:144')]..

这个json:

[
  [
    {
      "requestId": "56cd284767c74d3d4dd3ec81",
      "role": "Software Engineer",
      "roleName": "Software Engineer",
      "teamAssignments": [
        {
          "teamId": "Team:144",
          "teamName": "ABC!",
          "teamFactoryNumber": "123",
        }
      ]
    }
  ]
]  

有没有办法可以从requestId值中检索teamId

0 个答案:

没有答案