Skip to content

Importing Documents From Data Exports #32

@adam-hurwitz

Description

@adam-hurwitz

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

screen shot 2019-01-25 at 5 25 25 pm

  • users collection
    • user_one document
      - actions collection
      ...
      - categories collection
      ...
      - user data fields
    • user_two 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
          ...
      • user_two collection
        ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions