I have a Firebase website where users can upload their own files - much like a cloud storage service. I need a program/function that runs periodically and returns all the files that were first uploaded x days ago, as if the files have an expiration date and I need to know when they expire to perform maintenance. I am using Firebase Storage to store the user files themselves, and Firestore database to store the metadata for the files. However, I do not think my current Firestore structure will work for this, which is why I need help.
My current structure is like so:
users > *user-hash* > user-files > *file-hash*
I can structure the database differently if needed, I just do not know the best way to solve this problem with Firebase.