2
0
mirror of https://github.com/chubin/cheat.sheets synced 2024-11-19 03:25:44 +00:00

Merge pull request #93 from tlvince/patch-2

Add a jq filter example
This commit is contained in:
Igor Chubin 2020-02-11 19:14:09 +01:00 committed by GitHub
commit 8dcabf4c9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -82,3 +82,10 @@ jq -r '(map(keys) | add | unique | sort) as $cols | .[] as $row | $cols | map($r
#
# => 2,,1
# ,4,3
# Filter a list of objects
jq 'map(select(.name == "foo"))'
#
# [ { "name": "foo" }, { "name": "bar" } ]
# => [ { "name": "foo" } ]