I am currently developing an app using android studio and Java. This is my first project. I have Implemented Firebase Firestore.
I have a collection that contains my users as documents. For each record, there are field values containing their details. Some are Strings and Some are Numbers.
I have 3 exam types. (please refer attached Images)
I want to get all the Documents from a specific exam type.
and order them according to their marks. (Marks is a number field)
And I want the top 50 students to add to an ArrayList.
How to implement that query? Thanx.
I have tried this
CollectionReference colref= db.collection("Students");
colref.whereEqualTo("UpcomingExam", "Grade 5").orderBy("Marks", Query.Direction.DESCENDING).limit(3)
.get()
ArrayList was Empty. No code errors and also No results. This is only a part of the code... adding to ArrayList with for loop and others working correctly... My only concern is the query.