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

337
Views
Firestore query using multiple where, orderBy and startAt, endAt

So I have a query like this.

firestore()
    .collection('posts')
    .where('category', '==', category)
    .orderBy('price', 'asc')
    .startAt(minPrice)
    .endAt(maxPrice)
    .orderBy('title', 'asc')
    .startAt(searchString)
    .endAt(`${searchString}\uf8ff`)
    .limit(10)
    .get()
    .then(res => {
      console.log(res.docs);
      setPosts(res.docs);
    })

Where I filter first by category and than I want filter for price in and between min and max price

After that I also want to run this filter

.orderBy('title', 'asc')
.startAt(searchString)
.endAt(`${searchString}\uf8ff`)

To get the partial string match on title

The query is running without any error but it always return an emply array. Can anyone help me with this problem.

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!