I am trying to list the data in Firestore by Timestamp but it can't happening. With the whereGreaterThan
and OrderBy
.
db.collection("Users_Photos").document(uid).collection("ImageData").whereGreaterThan("image_timestamp",1506816000).orderBy("image_timestamp").addSnapshotListener(new EventListener<QuerySnapshot>() {
@Override
public void onEvent(QuerySnapshot documentSnapshots, FirebaseFirestoreException e) {
if(e!=null)
{
}
for (DocumentChange doc : documentSnapshots.getDocumentChanges())
{
if (doc.getType()==DocumentChange.Type.ADDED)
{
Photo photo = doc.getDocument().toObject(Photo.class);
photosList.add(photo);
photoListAdapter.notifyDataSetChanged();
String name = doc.getDocument().getString("image_location");
Log.d(TAG,name);
}
}
}
});