I have array of objects
var data = [{type:"A",parentPersonInfo:{id:1,fullname:'john smith'}},{type:"A",parentPersonInfo: {id:1,fullname:'jim smith'}},{type:"B",parentPersonInfo: {id:2,fullname:'jane smith'}}]
I want to use lodash to extract the records where type = A and id = 1
const testId = 1;
_.filter(data,{'type':'A','data.parentPersonInfo.id':1});
but i get []
Could you check if using the code below works?
_.filter(data, {type: 'A', parentPersonInfo: {id:1}});