JQ: Select multiple conditions

血红的双手。 提交于 2020-08-20 18:24:05

问题


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 ?


回答1:


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

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


来源:https://stackoverflow.com/questions/33057420/jq-select-multiple-conditions

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!