I have an array of objects which has a nested parameter in it and I want to return only those array elements that pass filter based on that nested parameter which is in turn also an array of objects.
[{q:1,w:2,props:{p:1, messages:[{status:true},{status:false},{status:true}]},
{q:3,w:5,props:{p:2, messages:[{status:false},{status:false},{status:false}]},
{q:7,w:0,props:{p:3, messages:[{status:false},{status:false},{status:true}]}
]
My aim is to filter only those objects that contain at least one message with status true. In this example I would expect to get an array of two objects
[{q:1,w:2,props:{p:1, messages:[{status:true},{status:false},{status:true}]},
{q:7,w:0,props:{p:3, messages:[{status:false},{status:false},{status:true}]}
]
Thanks for help and advice!