I am working on an Angular (version 9.1.13)
project where I am using Firestore , Fire version ("@angular/fire": "^6.1.5") , Firebase version ("firebase": "^8.10.1") for the database. I am trying to fetch data from Firestore using a query with where, orderBy, and limit methods. Here's my code:
const ref: CollectionReference = this.firestore.collection(this.path()).ref;
let query: Query = collectionRef
.where(...conditions...)
.where(...conditions...)
.orderBy('time', 'desc')
.limit(5);
this.subscription = query.snapshotChanges().subscribe((changes) => {}
But I am getting the error at query.snapshotChanges line saying - Property snapshotChanges does not exist on type Query
My questions -
- How can I correctly use snapshotChanges() for real-time updates with a filtered and ordered query in AngularFirestore?
- Is upgrading Firestore a viable solution for this issue?