Is it possible to copy a document from one Firestore sub-collection located in say "Collection A" to another sub-collection in a different collection say "Collection B" using Cloud Functions? And is it possible to do this periodically?
Asked
Active
Viewed 176 times
1
-
You sure can do these things. – Doug Stevenson Oct 22 '19 at 14:09
-
There are APIs for Firestore to [read data](https://firebase.google.com/docs/firestore/query-data/get-data) and [write data](https://firebase.google.com/docs/firestore/manage-data/add-data). Combining those would allow you to copy data. If you combine that with a [time-based trigger for Cloud Functions](https://stackoverflow.com/questions/42790735/cloud-functions-for-firebase-trigger-on-time), you're well on your way to having the tools needed for your use-case. – Frank van Puffelen Oct 22 '19 at 14:14
1 Answers
1
There are APIs for Firestore to read data and write data. Combining those would allow you to copy data. If you combine that with a time-based trigger for Cloud Functions, you're well on your way to having the tools needed for your use-case.

Frank van Puffelen
- 565,676
- 79
- 828
- 807