I have a simple array with 6 documents, one of them has a status of 1. I want to grab the value of a prop from the doc with this status and filter out the others docs with this value but the status 0.
ex.
{
"InviteId": 1, <================================= Keep
"InviteStatus": 1,
"PartnerCompany" : "Monstra",
"MeetingDate" : "2021-09-05T15:00:00.000+0000",
"MeetingStartTime" : "12:55",
},
{
"InviteId": 2,
"InviteStatus": 0,
"PartnerCompany" : "Empresa Teste",
"MeetingDate" : "2021-09-05T15:00:00.000+0000",
"MeetingStartTime" : "12:55",
},
{
"InviteId": 3, <================================= Exclude
"InviteStatus": 0,
"PartnerCompany" : "Monstra",
"MeetingDate" : "2021-09-07T15:00:00.000+0000",
"MeetingStartTime" : "12:55",
},
{
"InviteId": 4,
"InviteStatus": 0,
"PartnerCompany" : "Empresa Teste",
"MeetingDate" : "2021-09-07T15:00:00.000+0000",
"MeetingStartTime" : "12:55",
},
{
"InviteId": 5, <================================= Exclude
"InviteStatus": 0,
"PartnerCompany" : "Monstra",
"MeetingDate" : "2021-09-06T15:00:00.000+0000",
"MeetingStartTime" : "12:55",
},
{
"InviteId": 6,
"InviteStatus": 0,
"PartnerCompany" : "Empresa Teste",
"MeetingDate" : "2021-09-06T15:00:00.000+0000",
"MeetingStartTime" : "12:55",
}
In this example, InviteId: 1 has status: 1, this doc has de partnerName: Monstra. So I need to exclude the others docs where partnerName == Monstra with status == 0.
So the final list would have 4 docs (InviteIds: 1,2,4,6) and not 6 as it´s today.
cheers