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

644
Views
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 answers
Answer question

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 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!