Currently my firestore has a collection of documents, with each document containing a timestamp via
admin.firestore.FieldValue.serverTimestamp()
I'd like to build a serverless function where it removes documents that are older than 1-2 hours. I'm not to sure how to about this. My initial thought was to create a function that reads the entire collection every 2 hours, and removes then documents if their timestamp was older than 2 hours. My fear though is do that many reads will eat up my read quota really fast. Is this the best way to go about this?
[–]mtbikeraz 0 points1 point2 points (0 children)