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

103
Views
Generic firestore methods

I need to create many firestore queries with using soooo many where clause in a few services, here is example code:

let user = await db.collection('user');
    
if (firstName) {
    user = user.where("name", "==", firstname);
}

if (lastName) {
    user = user.where("lastName", "==", lastName);
}

//many many more where clause

return user.get();

I need to create something like this in a many places in my project, so now I have a question, Is there any possibility to create an one generic method to search in Firestore collections with using many where clause?

thanks for any help, i want to omit boilerplate in my project

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!