0

Attached an snapshot of how my structure looks like -

As in this image, I want to get all the data inside the document ASD21211AAZFKSW . The output to this would be - an array of ASD212zxd2aaaa and messages like [ASD212zxd2aaaa, messages]

Dharmaraj
  • 47,845
  • 8
  • 52
  • 84
Rishav Kumar
  • 4,979
  • 1
  • 17
  • 32
  • It seems you are trying to [list collections of a document](https://stackoverflow.com/q/46989568/13130697). What is that collection with random ID? If you are trying to store some data about that chat then you can store it in the document ASD21211AAZFKSW it self. – Dharmaraj Apr 25 '22 at 19:57
  • @Dharmaraj So basically, parent collection *chat* is a collection which contains all the user ID's in form of document, which you can take it as master document list through which we can find all those users who have initiated chats and each ID in document can have multiple user IDs which we store in sub collection where they have initiated chats with different users! – Rishav Kumar Apr 26 '22 at 05:25
  • I have found two guides/documentations that will provide you more details and clarifications: [How to query collections in Firestore under a certain path?](https://medium.com/firebase-developers/how-to-query-collections-in-firestore-under-a-certain-path-6a0d686cebd2) and [How to list all subcollections of a Cloud Firestore document?](https://medium.com/firebase-tips-tricks/how-to-list-all-subcollections-of-a-cloud-firestore-document-17f2bb80a166) – RJC Apr 26 '22 at 08:34

0 Answers0