Filter results on the Firestore console by timestamp field

Viewed 399

How can I filter the results on the Firestore Console by a timestamp field?

On the collection users, we have a field createdOn of type timestamp. If I want to filter the collection by field, I get the following dialog

Filter 'user' collection by 'createdOn'

I have tried entering the date as string

  • 2019-09-15
  • 2019-09-15T00:00:00Z

I have also tried using a timestamp as number in millis and seconds

  • 1568505600000
  • 1568505600

When looking at the requests sent to Firestore, the structured query uses a field filter with a value of corresponding to either stringValue or integerValue, but I think the timestampValue would be the right thing.

I do not want to adapt the query in the console and build my own requests. I know that there is always the option to sort the documents in the collection and then scroll to where it's interesting, but this will load all documents that are not relevant.

Is there a simple way to do what I want?

0 Answers
Related