I need to access all the collections within the documents stored in a collection named users.
This is how I currently retrieve all the user information:
export async function getServerSideProps() {
const snapshot = await firebase
.firestore()
.collection("users")
.orderBy("points", "desc")
.get();
let users = snapshot.docs.map((doc) => doc.data());
...
}
My goal is to extract the collections inside each user and store them in an array.
I specifically want to retrieve all the "quiniela" collections from each user and pass them as props. Is there a method to achieve this?