Reputation: 14219
I'd like to remove from an array objects that pass a test against a property'
Assume we have the following array:
[
{
"path": "a/b/v1-another"
},
{
"path": "a/b/v1"
}
]
I'd like to remove from the array the object that match the test a/b/*
against path
property
Upvotes: 0
Views: 701
Reputation: 158120
Like this:
jq '.[]|select(.path|startswith("a/b/")|not)' file.json
Upvotes: 3