Problem filtering in firebase

0

I'm trying to filter firebase data with a range of dates, the problem is that I always get null in the answer

var fechaFiltroIn = "1537107647902";
var fechaFiltroFin = "1537307647902";

var consultaHistorias = base.ref("historias").orderByChild("fecha").startAt(fechaFiltroIn ).endAt(fechaFiltroFin);
	consultaHistorias.on('value', function (snap){
		console.log(snap.val());
		

	});

    
asked by Gabriel Pacheco 18.09.2018 в 20:47
source

1 answer

0

Solved, The problem is that the query was wrong, the field "date" referred to in the query was inside a "daughter" of another "daughter" of "stories" so for the query the date field did not exist in the first daughter (orderByChild ("date")) therefore the result was always (null) Change the structure of the database and it works normally.

    
answered by 19.09.2018 в 20:09