In my Firebase Firestore, I have a large number of documents in a collection, each of which has a field called bookTime
, which stores a date in String format. The format is dd MM yyyy HH
, so we can't sort it in descending order to get a meaningful list with the latest document on top. The format we need for it to work properly is yyyy MM dd HH
. This is my query:
mQuery = mQuery.orderBy("bookTime", Query.Direction.DESCENDING);
What change should I make so I can actually get a list with the document having the newest bookTime
on top?