Select by timestamp in firestore

I have a Firestore collection with documents that have a field 'createdAt'. This is set as a firestore.server.timestamp.

I would like to get the documents that have createdAt >= someDate.

{{ Math.round((new Date(new Date().setDate(new Date().getDate() - 30)))/1000) }}

I set the retool query to be


This doesn't produce data.
I certainly have data that should pick up from the query.
Tried many variations (even trying to send UTC string formated time.
I couldn't find a clear example in the docs....did find one for setting the time and it does (more or less) the reverse of this (sends a integer).
Thanks

Hi there @jerry_onscreeninc.com

Happy to help you out here with your date formatting issue. When you're saying it doesn't produce data, what do you mean by that? I see that the date field get's evaluated to an integer. That's not what you want, correct?

Have you taken a look at our docs for working with dates? I'd recommend the moment library and all it's nifty functions.

Best

Pawan

Any help in how to correctly query Firestore then using a timestamp? That is what the author was asking (and the same help I am looking for). The documents are not helpful at all. Maybe @Pawan, you can try to recreate it to see how we are struggling as developers to work with Dates/Timestamps and Firestore.

Hi @Mulder Thanks for reaching out!

There is a more in depth conversation about this here that suggests using the raw query mode to solve for this issue. Could you try that solution?