I'm extremely new to firebase and need to display all the data in my collection. Within my app there is an integrated quiz function, and when the 'submit score' button is pressed, the data is sent to Firestore as a new document based on the uid.
user collection in firebase, new document based on uid .
This is what I have so far:
func getData() {
let db = Firestore.firestore()
// Get data
db.collection("users").getDocuments()
{
(querySnapshot, err) in
if let err = err
{
print("Error getting documents: \(err)");
}
else
{
for document in querySnapshot!.documents {
self.studentlbl.text = ("\(document.documentID) => \(document.data())");
}
}
}
This displays the following: result
I'm trying to figure out how to display the first name, followed by the user's corresponding score.
Thanks