[英]jq - How to filter out an object with multiple integers
我正在嘗試篩選出不包含數字'32'的數組,但它只會篩選出僅包含一個整數的數組。
{
"tags": [
21
]
}
{
"tags": [
32
]
}
{
"tags": [
21,
32
]
}
但是在運行時:
select(.tags[] == 32 | not)
我仍然得到一個包含32的數組。
您的過濾器正在尋找只有一個值32的標簽。
這應該做的工作:
select(.tags | contains([32]) | not)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.