Reputation: 39
So, I'm wondering how I can JSON path to the id 508018304019857419
, I'm trying out $[?(@ == 508018304019857419)].rolesList
but it just doesn't work. What can I do?
I'm trying to find 508018304019857419
and collect rolesList
JSON:
[
{
"508018304019857419":{
"rolesList":[
"Guest",
"Presidential Team",
"Chief Executive Officer",
"[-] Co Founder",
"[-] Founder",
"[-] Group Holder"
]
}
},
{
"222078108977594368":{
"rolesList":[
"Guest",
"Test1",
"Test2",
"Test3",
"Test4",
"Owner"
]
}
}
]
Upvotes: 1
Views: 58
Reputation: 239881
$.[508018304019857419].rolesList
should do.
$.
is all children of the root, [508018304019857419]
is the "508018304019857419" key of each of them (the ones that don't have such a key are filtered out), and then .rolesList
drills down.
Upvotes: 1