db
{
"people": {
"-MPRm-8iCWsKK6B_nuHA": {
"age": 30,
"mail": "[email protected]",
"name": "taro"
},
}
}
swift
let ref = Firestore.firestore().collection("people")
ref.getDocuments { (querySnapshot, error) in
if let querySnapshot = querySnapshot {
for document in querySnapshot.documents {
let id = document.documentID
let name = document.get("name") as! String
let mail = document.get("mail") as! String
let age = document.get("age") as! Int
// Do something.
}
}
}
Recommended Posts