firestore add to field array

Solutions on MaxInterview for firestore add to field array by the best coders in the world

showing results for - "firestore add to field array"
Magdalena
12 Feb 2018
1DocumentReference washingtonRef = db.collection("cities").document("DC");
2
3// Atomically add a new region to the "regions" array field.
4washingtonRef.update("regions", FieldValue.arrayUnion("greater_virginia"));
5
6// Atomically remove a region from the "regions" array field.
7washingtonRef.update("regions", FieldValue.arrayRemove("east_coast"));
similar questions
queries leading to this page
firestore add to field array