Hello, I have been learning to work with firebase, which I thought was wonderful, but due to my lack of experience, it is difficult for me to understand their documentation, so I ask for your help.
What I want is that when I show the records of my database in my Web application these are printed from bottom to top that is to say that the last record was shown in my app as the first one and so descending I tried to use 'orderByChild ()' but I have no result, I would also like to know how to sort the records by referring to the value of a node in this case "date", I also tried but I have no results I will leave part of the code to see if they can give me a hand I would be very grateful
const dbNoticias = firebase.database().ref('noticias/').orderByChild('fecha')
dbNoticias.on('value', function(snapshot){
var data= snapshot.val()
$('#noticias').empty()
var row=""
for(noticias in data){
var contenido= data[noticias].contenidoCorto
var mostrar= contenido.substring('0', '100')
row+='<div class="card-style animated fadeInDown">'+
'<img class="img-card" src="'+data[noticias].url+'">'+
'<div class="card-body">'+
'<h3><b>'+data[noticias].titulo+'</b></h3>'+
'<article>'+mostrar+' ... <a data="'+noticias+'" href="#" class="btnMostrar" >Leer más</a></article>'+
'</div>'+
'</div>'
}
$('#noticias').append(row)
var row=""})
thanks ...