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

484
Views
Is it possible to query firebase-firestore data by multiple criteria/values

Is it possible to query firestore with optional multiple criteria? Let's say I want to filter the data from firebase firestore collection if the user provides optional input from multiple input fields (example: Job Type, Salary range, location, date posted, etc... )

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

0

To build a query out of multiple conditions:

let query = firebase.firestore().collection("your collection");
if (jobType) {
  query = query.where("jobType", "==", jobType);
}
if (salaryRangeMin && salaryRangeMax) {
  query = query.where("salary", ">=", salaryRangeMin)
               .where("salary", "<=", salaryRangeax);
}
if (location) {
  query = query.where("location", "==", location);
}
const snapshot = await query.get();
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!