![](/img/trans.png)
[英]How can I tell if it's an image or video - Firebase Storage/Firestore
[英]How can I tell if I value already exists in Firebase Firestore?
沒有任何 function 來檢查文檔中是否存在字段。 您必須獲取文檔並檢查它是否存在:
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")
}
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.