I can not find a documentation on how to make a query in this case using ref.where () and orderBy () If I return the return using the where () I have no problem, but when I want to sort the results of 'desc' does not return anything Try adding the Index that Firebase offers, but it does not work either. I'm using:
Angular: 6.1.6
"angularfire2": "^ 5.0.0-rc.12",
This would be the code
this.figurasCollection = this.afs.collection<any>('figuras', ref => {
const query = ref.where('year_torneo', '==', '2019_apertura')
.where('division', '==', 'a_fds') ;
//Hasta acá funciona perfecto, pero si agrego el orderBy() evidentemente no se puede
query.orderBy('goles', 'desc');
return query;
});