set difference - JQ: setdiff of two arrays -


if have object 2 arrays containing unique values in it

{"all":["a","b","c","abc"],"some":["b","c"]} 

how can find .all - .some?

in case looking ["a","abc"]

@jeff mercado blew mind! didn't know array subtraction allowed...

echo -n '{"all":["a","b","c","abc"],"some":["b","c"]}' | jq '.all-.some' 

yields

[   "a",   "abc" ] 

Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -