1
In the android application that I’m trying to mount, I have a filter screen by registration date and I need to perform the query in the firestore cloud using this field, in the database it is the type Timestamp. I am currently trying to perform the query as follows:
db.collection("Presenca")
.whereGreaterThan("datacadastro", datacadastro)
.get()
.addOnCompleteListener(new OnCompleteListener<QuerySnapshot>() {
@Override
public void onComplete(@NonNull Task<QuerySnapshot> task) {
if (task.isSuccessful()) {
for (QueryDocumentSnapshot document : task.getResult()) {
alunosList.add(
new Presenca(
document.getString("nome").toUpperCase(),
document.getString("sala"),
document.getDate("datacadastro")));
recyclerView.setAdapter(adapter);
}
}
else {
Log.w(TAG, "Error getting documents.", task.getException());
}
}
});
}
Any tips on how to query these fields in the firestore cloud?