firebase-kotlin-sdk
firebase-kotlin-sdk copied to clipboard
How can I query using Timestamp?
trafficstars
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?