I've established a collection called "users" and within it, I have set up a subCollection named "innerGuides". While I know how to fetch data from the main collection "users", I'm curious about how to obtain the ID of my subCollection "innerGuides."
db.collection("users").doc(user.uid).collection("innerGuides").doc("BGP9O0Rh2ThiL40tXOVG").get().then(doc => {
console.log(user.uid);
console.log(doc.data().content);
}).catch(error => {
console.log(error);
})
As you can observe, I am able to retrieve the UID of my main collection through "user.uid"; however, when it comes to the subCollection, how can I dynamically retrieve its UID? I manually entered the subCollection's UID, but I'm looking for a way to grab it automatically.