I have a document with the following structure:
{
"email" : "a@gmail.com",
"value" : 100,
"children" : [
{
"email" : "b@gmail.com",
"value" : 100
},
{
"email" : "b@gmail.com",
"value" : 200
}
]
}
I want to remove all elements with the email b@gmail.com
from the children
array. I am able to remove one item if I pass the whole object to be removed like this:
FieldValue.arrayRemove(childObject)
But I want both the objects with the email b@gmail.com
to be removed. Is there anyway to achieve this using FieldValue.arrayRemove()
?