I have the following JSON array
[
{
"login": "foo",
"id": 111
},
{
"login": "bar",
"id": 222
},
{
"login": "foobar",
"id": 333
}
]
How can I leverage the jq
(preferrably) to check whether the object with "login": "bar"
is member of this array?
CodePudding user response:
Use any/1
.
any(.login == "bar")