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

642
Visualizações
Too many arguments provided to startAt

I am trying to search Firestore documents using StartAt() and EndAt() but I keep getting the error

Too many arguments provided to startAt(). The number of arguments must be less than or equal to the number of orderBy() clauses.

I also have OrderBy included as indicated in this stackoverflow post -> Firebase Error - Too many arguments provided to Query.startAt()

The firestore query is being called as part of AutoCompleteTextView, not sure whats the issue here....

val mIndFilter = FirebaseFirestore.getInstance()
mIndFilter.collection("Industries").orderBy("industry").startAt(queryString).endAt(queryString + '\uf8ff').limit(5).get()
    .addOnCompleteListener {
       if(it.isSuccessful){
               allIndList = it.result.toObjects(Industries::class.java)
       }
    }
    .addOnFailureListener { exception ->
        Log.e("Ind Search Filter fail", "Error adding document $exception")
    }
over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

i literally ran into the same problem yesterday. here is how i solved it. hopefully it works for you too. use where clauses instead of startAt and endAt.

.collection("Industries")
    .orderBy("Industries", "asc")
    .where("Industries", ">=", queryString)
    .where("Industries", "<=", queryString + "\uf8ff")
    .limit(5)
    .get();
over 4 years ago · Santiago Trujillo 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