Skip to content Skip to sidebar Skip to footer

Firestore Is Not Retrieving The Complete Data Values

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 -

Solution 1:

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,

  • If you are sure about your document IDs, you could directly access the collection
firestore.collection('users/groups/groupID/courses/others/courses').get()
  • Using 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 limitations
firestore.collectionGroup('courses').get()

Post a Comment for "Firestore Is Not Retrieving The Complete Data Values"