Reputation: 1956
I would like to get the names of all the documents inside a collection. I'm able to get the data, but I can't seem to find the value of the name stored anywhere.
let docRef = db.collection("selections").document("0").collection(Auth.auth().currentUser!.uid)
docRef.getDocuments { (docs, error) in
for d in docs!.documents {
print(d.data())
}
}
Upvotes: 0
Views: 31
Reputation: 1956
Not sure why I couldn't figure this our earlier.
let docRef = db.collection("selections").document("0").collection(Auth.auth().currentUser!.uid)
docRef.getDocuments { (docs, error) in
for d in docs!.documents {
print(d.documentID)
}
}
Upvotes: 1