I have a collection of users. Each user has an array named favoriteNames
.
root <- [Firestore]
users <- [Collection]
uid <- [Document]
favoriteNames: ["Ana", "Jane", "Dave"] <- [Array]
uid<- [Document]
favoriteNames: ["Ana", "Merry", "John"] <- [Array]
I want to remove "Ana" from all documents. This is what I tried:
usersRef.whereArrayContains("favoriteNames", FieldValue.arrayRemove("Ana").get()
But it doesn't work. How can I remove "Ana" from all arrays?