I am extracting a document from a collection called 'Users'. Then I want to push the document with some updations to a collection 'pending'.
The Invoke a cloud function every day and get data from my users' collection. Every document has a timestamp.
I check every day if the date is equal to the date on the server. if yes, then it executes the function for adding the data to the new collection pending.
How can I ensure if It will work correctly?
Thanks in advance!
There are several approaches to ensure the code works correctly:
Add test, you can add test for cloud function which can run locally or even against a real Firestore database. Check more details here: https://firebase.google.com/docs/functions/local-shell
You can also monitor the logs from Firebase console for the scheduled function. Console -> Cloud Function -> log -> select the function name
On the front-end, you can even add one more check to verify if the pending date in the expected time frame.