I am using Firebase Recycler Adapter on the Real Time Data Base (RTDB). Unfortunately, the query feature for the RTDB is quite limited and is causing me some problems. Here is the problem I am trying to solve:
Imagine I have an object model consisting of the name and the national origin of a person. I can query all the people with a particular national origin as shown below:
Query query = FirebaseDatabase.getInstance().getReference().child("People").orderByChild("nationalOrigin").equalTo("USA");
FirebaseRecyclerOptions<People> options = new FirebaseRecyclerOptions.Builder<People>()
.setQuery(query, People.class)
.build();
This correctly query all the people with national origin being "USA". However, what if I also want to sort the data alphabetically based on the name of the person before populating the recycle view. What is the best way of dong this?
Thanks in advance.