Quantcast
Channel: Active questions tagged jq - Stack Overflow
Viewing all articles
Browse latest Browse all 611

Proper use of select in select in jq

$
0
0

I have a file

[{key: 'value',key1:{key:'value'},fields:[{to:{id:'value'},field:{id:'value',name:'value'}},{key:'value'}]}]

I need to find elements of initial array which have and array .fields[] which have .field.id=='status' and .to.id=="closed"

I ve tried [.changelog[] | select(.fields[]|select(.field.id=="status" and (.to.key=="closed" or .to.key=="done")))]

A mistake 'cannot iterate over null' apears. Apparently, i can use .changelog[].fields but i cant use .changelog[].fields[]


Viewing all articles
Browse latest Browse all 611

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>