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

311
Vistas
How to query the array from the firestore using javascript?

So, I have this firestore that looks like the picture below. How can I query the arrays that I highlighted only to javascript format?

The array that I want is the highlighted one

How the Getting started with firestore does is by using [array-contains](https://firebase.google.com/docs/firestore/query-data/queries#:~:text=const%20q%20%3D%20query(citiesRef%2C%20where(%22regions,array_contains_filter.js) which looks like this as their example:

const q = query(citiesRef, where("regions", "array-contains", "west_coast"));

but what I see is that it only displays the word 'west_coast', what I want is that it will display any information in the field called 'amount' and 'title' as the picture above

about 4 years ago · Santiago Gelvez
1 Respuestas
Responde la pregunta

0

I'm afraid you can't. You need to retrieve the whole products array and filter locally.

Which leads to how your data is structured in Firestore. If that's the query you need, your data must have probably been structured differently.

For example:

  • products could be a subcollection of ordered
  • or, ordered documents may store the data you need to query in a separate, simplified array (like titles: [...], amounts: [...], but that won't help for sorting or ranges in numbers anyway).

Take a look at: https://firebase.google.com/docs/firestore/manage-data/structure-data for examples and use cases like this.

about 4 years ago · Santiago Gelvez 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