Skip to content

Latest commit

 

History

History
47 lines (43 loc) · 1.17 KB

firebase-utils.md

File metadata and controls

47 lines (43 loc) · 1.17 KB

Firestore Utils

At the moment Firestore admin panel doesn't allow to export/import data from their DB. These scripts allows you to load data on your machine, edit and bring it back. See examples to learn how it works.

Save collection/doc to file

    yarn firestore:copy sourcePath fileToSave.json
Examples:

Save a collection

    yarn firestore:copy partners/1/items general-partners.json

Save a document

    yarn firestore:copy partners/1/items/000 gdg-lviv-partner.json

Load a file to collection/doc

    yarn firestore:copy fileToLoad.json destinationPath
Examples:

Load to collection

    yarn firestore:copy general-partners.json partners/1/items

Load a document

    yarn firestore:copy gdg-lviv-partner.json partners/1/items/000

Copy collection->collection or doc->doc

    yarn firestore:copy sourcePath destinationPath
Examples:

Copy a collection

    yarn firestore:copy speakers backups/08-07-2018/speakers

Copy a document

    yarn firestore:copy speakers/yonatan_levin backups/08-07-2018/speakers/yonatan_levin