-
Notifications
You must be signed in to change notification settings - Fork 135
Description
Is there a way to import specific Firestore Database Documents under an exported Collection from Firebase Storage?
Observed
After creating a JavaScript AppEngine Cron Job according to the Schedule Export documentation there does not seem to be a way to import specific Documents, only Collections.
Expected
In-Short: The ability to export a specified Document representing a user.
The Firestore database of the app is currently structured with a users Collection at the highest level, and then a Document representing the user containing meta data, saved content, etc. A daily Cron Job has been scheduled with the documentation above in order to back up all of the Firestore data including the user data in the event users' data is inadvertently corrupted during development or maliciously in an attack.
However, from the Import specific collections documentation it appears only a Collection can be imported.
Existing Data Structure
- users collection
- user_one document
- actions collection
...
- categories collection
...
- user data fields - user_two document
...
- user_one document
Potential Solution if Importing Document Impossible
Refactoring the Firestore Database structure to add additional layers of Collections/Documents in order for each User to be represented by a unique Collection. The downside with the new data structure is you have a unnecessary additional users document 2nd level.
New Data Structure
- users collection
- users document
- user_one collection
- actions document
... - categories document
... - user data document w/ fields
...
- actions document
- user_two collection
...
- user_one collection
- users document
