I have a json data stored in firestore like below, the id of the doc is the date in ddmmyyyy format
29032019:{
morning:[{
person : 1,
name:'abc',
cancelled:false
},
{
person : 2,
name:'abc',
cancelled:false
}
],
afternoon:[{
person : 3,
name:'abc',
cancelled:false
},
{
person : 4,
name:'abc',
cancelled:false
}
]
}
30032019:{
morning:[{
person : 5,
name:'abc',
cancelled:false
},
{
person : 2,
name:'abc',
cancelled:false
}
],
afternoon:[{
person : 6,
name:'abc',
cancelled:false
},
{
person : 7,
name:'abc',
cancelled:false
}
]
}
here 9032019 and 30032019 are the document ids. How can i get the documents which contains a person inside the morning and afternoon arrays, so far i could do is to fetch documents by using next 3 upcoming dates and iterate through the morning and afternoon arrays to check a person with id 6 exists in the collection or not.