I am trying to get the documents inside an subcollection which is part of an document found with the .where function
Example:
- RootColl/
- Doc A/
- SubColl 1
- Doc 1
- Doc 2
- Doc 3
- SubColl 2
- Docs
- SubColl 1
- Doc A/
- SubColl 1
- Doc 1
- Doc 2
- Doc 3
- SubColl 2
- Docs
- SubColl 1
I want to get all the documents under SubColl 1
from the doc with the field level == 1
I am trying to do it like:
db.collection("RootColl").where("field", "==", "1").collection("SubColl 1").get()
But by doing that I get the error
Uncaught TypeError: db.collection(...).where(...).collection is not a function
EDIT 1: By following Frank van Puffelen suggestion, i get the same error, "collection" is not a function