Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

283
Visualizações
Firestore: get list of documents (but no all) in a collection

Let's supose I have a collection containing several documents, each of them named as something like FIS01181, or INF01202 (three upper case letters followed by four digits). This collection may have perhaps a thousand of these docs, but for each user will only need 40 ou 50. So I though it would be an nice optimization if each access only downloaded just it needed.

I know I could loop through these 50 docs I needed and download them individually; I tried this but it got really slow. Perhaps downloading all of them at once would be faster, but again, a lot of waste of network traffic (besides the higher billing). The Firestore reference hints that there is a function for this named where, but I don't know if that is exactly what I'm looking for:

const q = query(collection(db, "cities"), where("capital", "==", true));

I want to have an array of document names, like let arrayOfDocs = ["FIS01181", "INF01202"]; and get all of them from Firebase at once. Is it possible?

Note: I am using version 9 of Firebase with Javascript.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda