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

r - Trouble relying on third party package imports in my package -

Payment information shows nothing in one page checkout page magento -