I try to sort data depending on the timestamp of the data set. To do so I created this service:
import { Injectable } from '@angular/core';
import {AngularFirestore} from 'angularfire2/firestore';
@Injectable({
providedIn: 'root'
}) export class BlogService {
constructor(private afs: AngularFirestore) { }
getStudents() {
return this.afs.collection('Blogs', ref => ref.orderBy('ts')).valueChanges();
}
}
At the moment I receive the data in a ascending order but i want to receive it in a descending order, which means the newest value first.