Home > Net >  Firebase not fetching documents from collection for some collection
Firebase not fetching documents from collection for some collection

Time:11-14

Trying to fetch the all documents present in Users Collections but receiving empty list and when i tried to fetch Documents from Admins collections its working fine.

    this._fs
      .collection(FBMainCollection.Users)
      .get()
      .subscribe((usr) => {
        const data = usr.docs.map((e) => e.data());
        console.log(data);
      });

Response []

empty list

Unable to fetch documents from a few collections.

working only for collections which doesn`t have nested collections;

Documents in Users Collections

CodePudding user response:

Your screenshot shows that you don't have any documents in the Users collection. Notice how all of the document IDs are in italics, and none of them have any fields. That means there is no document there, but there is a nested subcollection under it that you can navigate into. Queries do not read any of the nested subcollections, so instead it just shows and empty collection..

See also:

  • Related