'how to access firestore subcollection using cloud functions
i have the following database model: car Workshops collection which is the root collections, and it has collections based on car Brands for example car Workshops ==> KIA(collection) and KIA collection have some fields and another sub collections called workshops
as following car Workshops ==> Kia (collection) ==> workshops
so i wants my code to return the wokrshops which is inside kia collection
screenshots of my database
Solution 1:[1]
U can use collection group query with specified document id. Try this, its work for me. CollectionGroupQuery but limit search to subcollections under a particular document
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Gieyudh |