LanreOyewole
2 years agoNew Contributor II
Using the Filter Snap on nested array
I have a JSON payload with a nested array (below). I am trying to use the filter Snap to select specific items only. Unfortunately, the expressions that I have tried have not worked - they select everything or nothing.
$myList.filter(x => x.num==1)
$myList.filter(x => x.num==1)[0].num==1
[{"myList":[{"msg":"Hello, World1","num":1,"type":"Q"},{"msg":"Hello, World2","num":2,"type":"X"},{"msg":"Hello, World3","num":3,"type":"Q"}]}]
Any help or suggestions will be very much appreciated.