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

146
Vistas
Firestore special query (with arrays)

Hey guys I'm having a problem with one of my queries!

I have some "store" docs, and in those docs I got an array of "products".

Each product has a "expirationDate". I would like to know how could I get the "store"'s where there is at least 1 expired "product". Something like:

const currentDate = new Date();
  db.collection("stores")
  .where("for each (product) {return product.expirationDate}", "<", currentDate.getTime())
  .get().then((querySnapshot) => {
    // Get all stores with at least 1 expired product
  });
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Firestore can only order/filter on values that are stored in the documents that it returns. If you want to filter on the number of expired products, you will have to store that value in a field in the document - and keep it up to date (for example in a daily process).

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