Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

291
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!