I'm using linqJs
When I try to get the id 5512
it returns null
, but when I get the 124
, it works.
$.Enumerable.From(structure).Where("$.id==5512").ToArray();
Object structure:
[{
"id": 124,
"text": "Pai",
"children": [
{
"id": 5511,
"text": "Filho 1"
},
{
"id": 5512,
"text": "Filho 2"
}
]
}]
How do I search for an ID regardless of the position it is in? In this case the 5512
I imagine that maybe I could do
$.children.id
but the array is dynamic so do not I have how to know the exact position, so I would like to search at allid