I have a response:
{"myRequests":[],
"requests":[
{"id":"4919fe948-f4bb-4863","profileId":1,"comments":"","title":"subject_1" ...(bla-bla-bla)...,"name":"Perf_1"},
{"id":"7295814a1-d1e7-440d","profileId":1,"comments":"","title":"subject_2" ...(bla-bla-bla)...,"name":"Perf_1"},
{"id":"0b548e6c2-ec40-4875","profileId":1,"comments":"","title":"subject_1" ...(bla-bla-bla)...,"name":"Perf_1"},
{"id":"39c603faf-e3f7-4666","profileId":1,"comments":"","title":"subject_2" ...(bla-bla-bla)...,"name":"Perf_1"},
"approvedRequests":[
{"id":"83b8f6a65-da90-4b98","comments":"accept_1", ...(bla-bla-bla)...,"name":"Perf_1"},
{"id":"4db544fd1-60fe-4b72","comments":"accept_1", ...(bla-bla-bla)...,"name":"Perf_1"},
{"id":"24705ef9f-7c5c-4d43","comments":"accept_1", ...(bla-bla-bla)...,"name":"Perf_1"},
{"id":"9d5238283-3da9-4d7d","comments":"accept_1", ...(bla-bla-bla)...,"name":"Perf_1"},
]}
I try to use
$.requests[?(@.comments=="")].id[0]
$.requests[?(@.comments=="" && @.title=="subject_2")].id[0]
but don't see effect - what I'm missing?
What should be correct json path in this case, to have "id" only from the part with "requests" and given "title":"subject_2" parameter?
question from:
https://stackoverflow.com/questions/65946765/json-path-how-to-get-id-only-from-the-part-with-requests-and-given-title