How To Fetch Documents From One Month Old Only Firestore
I'm doing a query to fetch only 1 month old documents. I store the creation time of the document itself timestamp : 9 Apr, 2020 10:03:43 AM Now, in my query , I want to get all th
Solution 1:
Firestore does not offer timeboxed queries that restrict a range of documents based on the sense of server time. You will have to trust that the client is sending the correct time.
The only control you have over time is using request.time in security rules. You could write a rule to allow queries that only fall within times based on the server timestamp, but it's still up to the client to specify the time correctly in the query. The rules will not be able to filter results based on time.
You might want to read more about how server timestamps work with security rules at the end of this article.
Post a Comment for "How To Fetch Documents From One Month Old Only Firestore"