有没有一种方法可以从firestore-document中读取数据,并且仅接收字段值,而不能接收field-ref-name?
现在,例如“豪华床23xe9:€10000”,而不是仅收到价格“€10000”。
这是我为从Firestore中读取数据而触发的代码:
let db = Firestore.firestore()
let docRef = db.collection("name").document("price")
docRef.getDocument { (document, error) in
if let document = document, document.exists {
let dataDescription = document.data().map(String.init(describing:)) ?? "nil"
print("Document data: \(dataDescription)")
} else {
print("Document does not exist")
}
}
谢谢
编辑:道格在某种程度上非常有趣(我已经多次见过你),因为重复/已经有了答案。好吧,如果是这样,那么当此主题适用于iOS时,不要将解决方案嵌入到有关ANDROID的线程中。