I am having Ticket Posting Web App, and i would show only those tickets which are active and with-in 24 hours records(from now on).
I am using Firebase Cloud Firestore with Angular 7.
getTicketList(){
this.ticketData =
this.fireStore.collection('ticket').doc("paid").collection("ticket-list",
ref =>
ref.where('status', '==',
"active").where("paid","==","false").orderBy("myTimeStamp");
return this.ticketData.snapshotChanges() ;
}
We are having a a key "myTimestamp" which is Firestore Timestamp Type.
want to show only those records which are active and currently having a time remaining to book.
Beow i mentioned the codes which i am using to get from Firebase service.
this.firestore.getTicketList().subscribe(list => {
this.ticketList = list.map(item => {
return { id:item.payload.doc.id,
...item.payload.doc.data()}
})
console.log(this.ticketList);
});
Thanks
Edited

