Can't deploy cloud function with firestore document creation trigger - Stack Overflow

admin2025-05-02  0

My deployment command:

gcloud functions deploy send-verification-mail ^
  --gen2 ^
  --runtime=python312 ^
  --trigger-location=asia-south2 ^
  --region=asia-south2 ^
  --source=. ^
  --entry-point=send_verification_mail ^
  --set-env-vars GOOGLE_CLOUD_PROJECT=myproject ^
  --trigger-event-filters=type=google.cloud.firestore.document.v1.create ^
  --trigger-event-filters-path-pattern=document='users/{username}'

This results in:

ERROR: (gcloud.functions.deploy) ResponseError: status=[400], code=[Ok], message=[Validation failed for trigger projects/myproject/locations/asia-south2/triggers/send-verification-mail-878142: The request was invalid: Operator match-path-pattern is not supported for attribute document within event type google.cloud.firestore.document.v1.create]

转载请注明原文地址:http://anycun.com/QandA/1746133290a92034.html