Reputation: 59
Image 1 shows the hierarchy of my DB.
I am trying to retrieve the names of the courses [Android, Branding .... ]. The data in italics(Branding, others) gets added by the backend - post commands, and the other data is added typing. While retrieving only the non - italics data gets retrieved as seen in screenshot 2. I can not figure out why this might be happening. Screenshot 2 also shows the query I am using to the same. Please help !!
Upvotes: 0
Views: 418
Reputation: 1405
While retrieving only the non - italics data gets retrieved as seen in the screenshot 2
Document IDs shown in italics - means there is not actually a document in its place; however, there are subcollections with documents organized underneath them. Firestore query returns only non-empty documents.
You have two options to go with,
firestore.collection('users/groups/groupID/courses/others/courses').get()
collectionGroup
queries; but it seems you have many collections with same ID courses
, so it might retreive all and might not be suitable for you! I recommend you to read firabase doc for it's limitationsfirestore.collectionGroup('courses').get()
Upvotes: 2