'firestore query filter by date in firebase console

I am wondering how to filter firebase firestore by date field, as I can't see data type other than String, Number, Boolean

As below, please advice if someone find a way to filter firestore collection based on date field.

enter image description here



Solution 1:[1]

I think it's not possible at the moment. I found this documentation on GCP which is practically the same UI. There is a little bit about filtering, but not many details.

I think that this UI is just for support/test purposes not for everyday use so such feature is not really needed. It's working with API with no problem ( you can check example in JS in this SO question).

If you need this feature you should raise a Feature Request here.

Solution 2:[2]

I believe the only thing you can do at this point is apply a filter on your timestamp fields and set the sort order without a condition. The results will show the timestamp field value so it is easy to scan for the time range you are interested in.

Obviously this is not awesome for large document sets where the interesting date is somewhere in the middle but at least sort order will let choose if you want to scroll from the first or last documents by date.

This approach is described in a Firebase Blog post: Sort and Filter in the Firestore Console

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 vitooh
Solution 2 ajbarry