Skip to content

Extension for firebase-firestore to keep track of document versions. Soft deletes and restore operations included

Notifications You must be signed in to change notification settings

InGaussiana/ext-firestore-document-version

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Firestore Document Versioning

Author: Gaussiana

Description: Creates firestore documents versions on document writes. Supporting soft delete and recover

Details: Use this extension to save history of changes in all the documents on a collection

Billing

This extension uses other Firebase or Google Cloud Platform services which may have associated charges:

  • Cloud Functions

When you use Firebase Extensions, you're only charged for the underlying resources that you use. A paid-tier billing plan is only required if the extension uses a service that requires a paid-tier plan, for example calling to a Google Cloud Platform API or making outbound network requests to non-Google services. All Firebase services offer a free tier of usage. Learn more about Firebase billing.

Configuration Parameters:

  • Collection path: Collection path to versionate

  • History collection path: Collection path where to save history data

  • Enable restore operation: Enable keep track of deleted documents and its versions (like a soft delete). Giving the possibility to restore deleted documents

  • Ignore fields: Comma separated fields that won't trigger a new history version (nor will be saved on the version data). Nested fields are supported with parent.child syntax.

  • Restore field name: Field used for restore document operation. This must be the only field in the document's update, in order to restore the document wanted.

  • Goto field name: Field used for goto version operation. This must be the only field in the document's update, in order to goto the version wanted.

  • Undo field name: Field used for undo version operation. This must be the only field in the document's update, in order to undo the change.

  • Redo field name: Field used for redo version operation. This must be the only field in the document's update, in order to redo the change.

  • Actual version field name: Field used to keep track in which version the document is. This must not be changed manually, ever!.

Cloud Functions:

  • manageDocumentVersions: Firestore-OnWrite-triggered function that creates the versions of documents

Access Required:

This extension will operate with the following project IAM roles:

  • datastore.user (Reason: Allows the extension to write to Firestore.)

About

Extension for firebase-firestore to keep track of document versions. Soft deletes and restore operations included

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published