Admin Utils Firestore
Helpers used for common admin task on Firestore databases.
Installation:
- Install the package via:
$ npm install --save admin-utils-firestore
- Init admin-utils-firestore via:
;const adminUtilsFirestore = ;
Documentation:
Collections
Target a firestore collection reference via:
const colRef = db;const utilColRef = adminUtilsFirestore;
API
- deleteFieldDocs
For each documents in a referenced collection performs a delete operation of the old field key
utilColRef
- importDocs
Allow to import documents in a collection using a bulk operation
utilColRef
- renameFieldDocs
For each documents in a referenced collection performs a update operation of the new field key, and then performs, if it exist, a remove operation of the old field key
utilColRef
Documents
Target a firestore document reference via:
const docRef = db;const utilDocRef = adminUtilsFirestore;
API
- renameField
For the referenced document performs a update operation of the new field key, and then performs, if it exist, a remove operation of the old field key
utilDocRef
Just a reminder
This in a unofficial library for Firestore (https://firebase.google.com/docs/firestore) we recommend replicating the operation, where it's possible, in a test project to check if the output is what expected before to run any operation in a production environment. Thanks for using and testing this library!
Contributing
For bugs and feature requests please Create an Issue.