Currently, I am working on developing both a mobile app and web app for my Final Year Project. As someone relatively new to Firestore, I am using a single instance of it to store data.
When a customer registers through the mobile app, their information gets stored in the "users" collection with a unique ID representing each individual customer [Document]. This is further divided into sub-collections like "profile" and "orders" to store specific details.
After a successful registration, here's how the current Firestore setup looks:
While attempting to display the "Profile" sub-collection in my web application, I've managed to do so but only for a single user at a time.
created() {
db.collection('users/FbkKmQMaGYY2gErEneImmjUMvRt1/profile').onSnapshot((snapshotChange) => {
this.Users = [];
snapshotChange.forEach((doc) => {
this.Users.push({
key: doc.id,
fname: doc.data().fname,
lname: doc.data().lname,
username: doc.data().username,
mail: doc.data().mail,
phone: doc.data().phone,
address: doc.data().address,
img: doc.data().img,
})
});
})
},
My query is: Are there any methods that would allow me to retrieve ALL instances of the "Profile" sub-collection (as shown in the image), enabling me to display them in my Web Application for administrative purposes?
Thank you in advance for your assistance! :)