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

169
Views
Query a list of documents in firestore using an array

Is is possible to query a list of documents in firestore using an array of IDs?

const UserIDs = ['zHYYvrVPLA9LOV6edwOrQhQLt6k1', 'JhUvvrNbfD9LOV6edwOrQhQLt8Gf'
'] //each ID in the array is an existent document id in the collection Users

const selectedUsers = await firestore().collection('Users').doc(UserIDs).get();

selectedUsers.data() is undefined despite that the documents with the given IDs exists. I know I can perform a loop, I was just wondering if the way I tried is possible.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can use the in operator and the FieldPath.documentId() function to build a query that can get up to 10 documents by their ID.

Something like:

firestore().collection('Users')
  .where(FieldPath.documentId(), 'in', UserIDs)
about 4 years ago · Juan Pablo Isaza Report
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!