-
-
Save VimleshS/9e42e009cd3aa48b6723a80a8f8e294f to your computer and use it in GitHub Desktop.
Revisions
-
joar revised this gist
Oct 28, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,7 @@ echo '{"hello": "world"}' | jq --arg foo bar '. + {foo: $foo}' # "foo": "bar" # } # Override field value echo '{"hello": "world"}' | jq --arg foo bar '. + {hello: $foo}' { "hello": "bar" -
joar revised this gist
Oct 28, 2015 . 1 changed file with 8 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,4 +12,11 @@ echo '{"hello": "world"}' | jq --arg foo bar '. + {hello: $foo}' } # { # "hello": "bar" # } # Concat and add echo '{"hello": "world"}' | jq --arg foo bar '. + {hello: ("not" + $foo)}' # { # "hello": "world", # "foo": "notbar" # } -
joar revised this gist
Oct 28, 2015 . 1 changed file with 10 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,15 @@ # Add field echo '{"hello": "world"}' | jq --arg foo bar '. + {foo: $foo}' # { # "hello": "world", # "foo": "bar" # } # Change a field echo '{"hello": "world"}' | jq --arg foo bar '. + {hello: $foo}' { "hello": "bar" } # { # "hello": "bar" # } -
joar revised this gist
Oct 28, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ echo '{"hello": "world"}' | jq --arg foo bar '. + {foo: $foo}' # { # "hello": "world", # "foo": "bar" -
joar created this gist
Oct 28, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ echo '{"hello": "world"}' | jq --arg foo bar '. | . + {foo: $foo}' # { # "hello": "world", # "foo": "bar" # }