Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49231

Firebase service - Getting data from firestore

$
0
0

Hey,
I’m working on an ionic firebase application. And for that i have a service file for firebase to get data from different collections. It was working fine before. But now i’m getting a error
public getMyReviews(id): Promise {

return new Promise<any>((resolve, reject) => {

  this.adb.collection('reviews', ref => ref.where('restId', '==', id)).get().subscribe(async (review) => {

    let data = review.docs.map((element) => {

      let item = element.data();

      item.id = element.id;

      item.uid.get().then(function (doc) {

        item.uid = doc.data();

      });

      return item;

    });

    resolve(data);

  }, error => {

    reject(error);

  });

});

}

The error is in the line item.id = element.id and item.uid.get(), the error says that cannot find item.id or item.uid. What is the problem? i don’t know what change made this error to come

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 49231

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>