skip to Main Content

enter image description here

How can I get the value of coursestatus from all of the collections?

2

Answers


  1. See Get all documents in a collection

    You loop or iterate over it.

    const querySnapshot = await getDocs(collection(db, "cities"));
    querySnapshot.forEach((doc) => {
      // doc.data() is never undefined for query doc snapshots
      console.log(doc.id, " => ", doc.data());
    });
    
    Login or Signup to reply.
  2. If you want to get the value of coursestatus field which exists in multiple CourseCompletion sub-collections, then you have to perform a collection group query.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search