#jq コマンドでオブジェクトの配列から key の value で検索絞り込みする例
オブジェクトの配列から検索する場合
map と select を組み合わせて使う
$ echo '[{"answer": "yes"} , { "answer" : "no"}]' | jq 'map(select(.answer == "yes"))'
[
{
"answer": "yes"
}
]
フラットな複数個以上のJSONから検索する場合
select だけで良い
$ echo '{"answer": "yes"} { "answer" : "no"}' | jq 'select(.answer == "yes")'
{
"answer": "yes"
}
Original by Github issue
Author And Source
この問題について(#jq コマンドでオブジェクトの配列から key の value で検索絞り込みする例), 我々は、より多くの情報をここで見つけました https://qiita.com/YumaInaura/items/edefc470c5f31949c208著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .