Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

97
Vistas
firestore filter range date

Why when I do this filter it returns all records from my database? What I need is that it returns only records within the range of the two dates.

async function toFind() {
console.log("start", dateRangePicker.start);
console.log("end", dateRangePicker.end);
const importacao = db.collection("importacao");
 await importacao
  .orderBy('data')
  .where("data", '>=', dateRangePicker.start)
  .where("data", '<=', dateRangePicker.end)
  .get()
  .then((snapshot) => {
    if (snapshot.empty) {
      toast.error('No matching documents.');
      return;
    }

{ //database comentario: "teste", custo:"3,000", data:"18/08/2021", dolar:"5.56" }

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You seem to be storing your dates as string values with the format "dd/MM/yyyy". That is not a great format for storing dates, as strings are ordered lexicographically and in that order "18/08/2021" is before "19/09/2020".

If you want to store dates, do so in an ISO-8601 format like "2021-08-18". In that format the lexicographical order is the same as the chronological order, so you get the result you want.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda