Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

321
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda