Webux Lab

By Studio Webux

JQ Notes

TG
Tommy Gingras Studio Webux 2024-11-10

Bash and JQ Commands notes

Convert all values to string inside an object.

jq '.initialFunds = (.initialFunds | to_entries | map(.value |= tostring) | from_entries)' \
    INPUT.json > INPUT.tmp && mv INPUT.tmp OUTPUT.json

Delete an Object and save the rest of the JSON input.

jq 'del(.staking)' OUTPUT.json > OUTPUT.tmp && mv OUTPUT.tmp OUTPUT.json

Search