Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

remove and element from array firebase swift 5

let washingtonRef = db.collection("cities").document("DC")

// Atomically add a new region to the "regions" array field.
washingtonRef.updateData([
    "regions": FieldValue.arrayUnion(["greater_virginia"])
])

// Atomically remove a region from the "regions" array field.
washingtonRef.updateData([
    "regions": FieldValue.arrayRemove(["east_coast"])
])
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #remove #element #array #firebase #swift
ADD COMMENT
Topic
Name
9+7 =