I'm having trouble implementing boolean checks into jq. If I have a field "test" which can be a boolean true or false, how do I use select to find this?
Initially I tried the following:
jq '.[] | select(.test=="false")'
But I think I am comparing strings here so this will not work.
The JSON boolean values are true
and false
, so just drop the quotation marks, e.g. select(.test == false)
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With