Skip to content

Instantly share code, notes, and snippets.

@mrmemmo
Created November 30, 2020 20:48
Show Gist options
  • Save mrmemmo/b27946602173af74906bd9b78c06d0a1 to your computer and use it in GitHub Desktop.
Save mrmemmo/b27946602173af74906bd9b78c06d0a1 to your computer and use it in GitHub Desktop.
delete.swift
print(dID)
var db = Firestore.firestore()
db.collection("bookings").whereField("UID", isEqualTo: dID).getDocuments() { (querySnapshot, err) in
if let err = err {
print("Error getting documents: \(err)")
} else {
for document in querySnapshot!.documents {
document.reference.delete()
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment