Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I query using Timestamp? #690

Open
LucianBusuioc opened this issue Dec 27, 2024 · 0 comments
Open

How can I query using Timestamp? #690

LucianBusuioc opened this issue Dec 27, 2024 · 0 comments

Comments

@LucianBusuioc
Copy link

I am trying to get some documents from the firestore where a field is bigger that a Timestamp value but the query is empty.

What I tried with documents that have the serverTimestamp way in the past:
This is working:

query = query
                .limit(5)

query = query
                .orderBy("serverTimestamp")
                .limit(5)

This is not working

  query = query
                .where("serverTimestamp", greaterThan = Timestamp(0, 0))
                .limit(5)

 query = query
                .where("serverTimestamp", lessThan = Timestamp.now())
                .limit(5)

 query = query
                .where("serverTimestamp", lessThan = Timestamp.ServerTimestamp)
                .limit(5)

 query = query
                .where("serverTimestamp", lessThan = Timestamp(1735288355, 0))
                .limit(5)
      



What am I doing wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant