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

173
Visualizações
Firestore GET all Boolean TRUE then append FALSE values

I need a request/ request flow that retrieves all the documents where the boolean is true and then gets all that is false.

Is there a firestore query I can make that does this? An orderBy?

Currently, I have an InfiniteScroll and I am struggling for the display to switch between getting true values to getting false values.

    if (res.data.length < ITEMS_PER_PAGE) {
        if (onlyListed) {
          // transition from true to false
          setLastVisible(null);
          setOnlyListed(false);
        } else {
          // already transitioned so no more true or false values
          sethasMore(false);
        }
     }

It seems the issue is currently it doesn't switch between getting true to false seemlessly on ReactJs side. So a firestore query that fetches all true then false would be perfect as then I can use a regular pagination flow that I know works.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

If you want only the documents where the onlyListed field value is true, you can use a query:

ref.where('onlyListed', '==', true)

If you want all documents with the onlyListed field, no matter its value, but with them grouped by their value, you can use an ordered query:

ref.orderBy('onlyListed')

If this gives the wrong order, you can reverse it by:

ref.orderBy('onlyListed', 'desc')
about 4 years ago · Juan Pablo Isaza Relatório
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