remove item from array || Increment Value || union array

PHOTO EMBED

Tue Jan 31 2023 05:05:23 GMT+0000 (Coordinated Universal Time)

Saved by @hasnat #ios #swift #remove #increment #union

// Remove item from array

let db = Firestore.firestore()
            db.collection("Products").document("").updateData(["" : FieldValue.arrayRemove(["89024"])])

// increment value             
            db.collection("Products").document("").updateData([
                "field_name" : FieldValue.increment(Int64(3))
                    ])
                    
// union array
                    
            db.collection("collection_name").document("document_id")
            documentRef.updateData([
              "field_name": FieldValue.arrayUnion(["element1", "element2", "element3"])
            ])
content_copyCOPY