I have an onWrite()
firestore trigger defined like this:
exports.onWriteTest = functions.firestore.document('test/{docId}').onWrite(async (snap, context) => { ... }
This works fine when I write or update a document in the test
collection using the Firestore UI. But if I write using a python script that should be doing the writing it wont get trigged. Here is the python script:
data = {...}
cred = credentials.Certificate(config_path)
firebase_admin.initialize_app(cred)
db = firestore.client()
collection_ref = db.collection('test')
for key, val in data.items():
collection_ref.document(str(key)).set(val)
source https://stackoverflow.com/questions/75784364/firestore-onwrite-doesnt-trigger-if-the-writer-is-a-python-script
Comments
Post a Comment