Hello everybody I am check in the official webside of firebase how to retrieve all the documents from a collection but it gives me just 1 and it is not the first one not the last but somewhere in the middle and it is always the same object and I couldnt understand why it is so. Can you check and maybe see what I am doing wrong? I am always getting the document: "companion_live"
private firestore: AngularFirestore;
constructor(private routingService: RoutingService, firestore: AngularFirestore) {
this.firestore = firestore;
}
async ngAfterViewInit() {
const citiesRef = this.firestore.firestore.collection('user');
const snapshot = await citiesRef.get();
snapshot.forEach((doc) => {
this.allTruckRoute.push(doc.id);
});
if (this.allTruckRoute.length > 0) {
this.allTruckRoute.forEach(route => this.trucks.push({id: route, selected: false} as SelectedTrucks));
}
}
this is how my schema looks like: