
我想收到一個通知,bool讓我知道我的檔案是否有Wasiyyah..
我試過的:
Firestore.firestore().collection(user!.uid).document(docID).value(forKey: "Wasiyyah")
每次只會崩潰,所以這里一定有一些我不理解的東西。
uj5u.com熱心網友回復:
沒有任何功能可以檢查檔案中是否存在欄位。您必須獲取檔案并檢查它是否存在:
let docRef = Firestore.firestore().collection(user!.uid).document(docID)
docRef.getDocument { (document, error) in
if let document = document, document.exists {
let data = document.data()
// Check if the field exists in data
} else {
print("Document does not exist")
}
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/429148.html
