File tree Expand file tree Collapse file tree 3 files changed +26
-1
lines changed
firestore-bigquery-export Expand file tree Collapse file tree 3 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -647,6 +647,21 @@ params:
647647 default : info
648648 required : true
649649
650+ - param : IGNORE_DOCUMENT_DELETION
651+ label : Ignore Document Deletion
652+ description : >-
653+ If enabled, Firestore deleted document will not be exported (the Firestore
654+ onDocumentDeleted event will be ignored). The reduction in data should be
655+ more performant, and avoid potential resource limitations.
656+ type : select
657+ required : false
658+ default : no
659+ options :
660+ - label : Yes
661+ value : yes
662+ - label : No
663+ value : no
664+
650665events :
651666 # OLD event types for backward compatibility
652667 - type : firebase.extensions.firestore-counter.v1.onStart
Original file line number Diff line number Diff line change @@ -77,4 +77,5 @@ export default {
7777 process . env . BACKUP_GCS_BUCKET || `${ process . env . PROJECT_ID } .appspot.com` ,
7878 backupDir : `_${ process . env . INSTANCE_ID || "firestore-bigquery-export" } ` ,
7979 logLevel : process . env . LOG_LEVEL || LogLevel . INFO ,
80+ ignoreDocumentDeletion : process . env . IGNORE_DOCUMENT_DELETION === "yes" ? true : false ,
8081} ;
Original file line number Diff line number Diff line change @@ -173,7 +173,16 @@ export const fsexportbigquery = onDocumentWritten(
173173 const fullResourceName = `projects/${ projectId } /databases/${ config . databaseId } /documents/${ relativeName } ` ;
174174 const eventId = context . id ;
175175 const operation = changeType ;
176-
176+
177+ if ( config . ignoreDocumentDeletion && isDeleted ) {
178+ logs . logEventAction (
179+ "Firestore event received and ignored by onDocumentWritten trigger" ,
180+ fullResourceName ,
181+ eventId ,
182+ operation
183+ ) ;
184+ return ;
185+ }
177186 logs . logEventAction (
178187 "Firestore event received by onDocumentWritten trigger" ,
179188 fullResourceName ,
You can’t perform that action at this time.
0 commit comments