I want to do something like this.
return await this.fooCol.doc(id).update({
images: firebase.default.firestore.FieldValue
.arrayRemove(...data.removedImages).arrayUnion(...data.addedImages),
}); //doesnt work
I'm current doing this where I use Promise.all()
return await Promise.all([
this.fooCol.doc(id).update({
images: firebase.default.firestore.FieldValue.arrayRemove(
...data.removedImages
),
}),
this.fooCol.doc(id).update({
images: firebase.default.firestore.FieldValue.arrayUnion(...imageUrls),
}),
]);
But is there any other way than using Promise.all()?