I want to add another answer to this old question, because I prefer the use of basic tools (available on most systems) and I’d like to clarify why the trivial approach doesn’t work.
Why trivial approach will not work?
cat sample.json | jq '.Actions[] | select (.properties.age == "3") .properties.other = "no-test"' >sample.json
At first glance this looks fine but it does not work.
First of all, problem with overriding file comes from >sample.json not the jq itselft.
When you use >sample.json, the shell immediately opens the file for writing before jq starts reading it, which truncates the file to zero length.
How to work around it? Simply use a command that handle output itself (like sed -i wget -O etc. ) not via shell redirections.
cat sample.json | jq '.Actions[] | select (.properties.age == "3") .properties.other = "no-test"' | dd of=sample.json status=none