190

I have a json and at the moment using select to get only the data which match one condition, I need to filter based on more conditions.

For e.g:

.[] | select((.processedBarsVolume <= 5) && .processedBars > 0)

How I can do this ?

jq170727
  • 11,184
  • 3
  • 39
  • 52
Andrei Colta
  • 2,022
  • 2
  • 8
  • 4

1 Answers1

395

jq supports the normal Boolean operators and/or/not, so it would look like:

.[] | select((.processedBarsVolume <= 5) and .processedBars > 0)
Hans Z.
  • 46,131
  • 10
  • 91
  • 111