I am retrieving data from Firestore and I want to add an order of retrieving it, so I have tried this code:
Query query = firebaseFirestore.collection("docs").orderBy("date", Query.Direction.DESCENDING/*ASCENDING*/);
FirestoreRecyclerOptions<download> docsFirestoreRecyclerOptions = new FirestoreRecyclerOptions.Builder<download>()
.setQuery(query, download.class)
.build();
In date, I am adding time and date in String type like
02:42:31 - 2020/08/01
by this, I want to make sure the newest post appears on the top of recycler view. it works well in this day but the next day if the time let's say
01:00:00 - 2020/08/02
It is will appear before the post that added the previous day. Is there a better way to ordering data from Firestore?