I have a firestore collection 'orders' whose documents has a timeStamp value. I want to filter documents of that collection based on timeStamp. For example, filter orders placed on July 1 ,2022. I pass date value got from Datepicker as DateTime. The query i formed is
_db.collection('orders')
.where('driverId', isEqualTo: sp.getString('uid'))
.where('timeStamp', isGreaterThanOrEqualTo: Timestamp.fromDate(pickedDate!))
.get().then((querySnapshot){
querySnapshot.docs.forEach((element) {
orders.add(element.data());
});
print(orders.length);
});
The problem is i'm getting orders from July 1 till today since i have given isGreaterThanOrEqualTo. But if i give isEqualTo,it returns nothing. Means it takes 01-07-2022 00:00:00 i guess. So what is the correct query to get orders on a selected date?