JQ:选择多个条件 [英] JQ: Select multiple conditions
本文介绍了JQ:选择多个条件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个json,目前使用select仅获取符合一个条件的数据,我需要根据更多条件进行过滤.
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.
例如:
.[] | select((.processedBarsVolume <= 5) && .processedBars > 0)
我该怎么做?
推荐答案
jq
支持普通的布尔运算符和/或/不支持,因此看起来像这样:
jq
supports the normal Boolean operators and/or/not, so it would look like:
.[] | select((.processedBarsVolume <= 5) and .processedBars > 0)
这篇关于JQ:选择多个条件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文