Currently, I am developing an Ionic project and facing an issue with displaying firebase documents on the screen. My goal is to order these documents by date, which is a field of type date in each document within my collection:
Below is the code snippet that I have implemented to fetch firebase documents for my application.
constructor(private aF: AngularFirestore, private aS: AuthServiceService) {
this.aF.collection('orders', ref => ref.where('location', '==', 'Store Name Example')).valueChanges().subscribe( data => {
this.userOrders = data;
});
}
I would greatly appreciate any assistance!