Guest User

Untitled

a guest
Oct 22nd, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. {"success": true, "results": {"a": …, "b": …, "c": …}}
  2.  
  3. {"success": true, "results": {"b": …}}
  4.  
  5. $ jq 'del(select(.results.b | not))'
  6. {"success": true, "results": {"a": …, "b": …, "c": …}}
  7. # removes nothing from "results"
  8.  
  9. $ jq 'with_entries(select(.key == "success" or .key == "results.b"))
  10. {"success": true}
  11. # nested comparison not understood; returns only "success"
Add Comment
Please, Sign In to add comment