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"));