相关疑难解决方法(0)

firestore云函数onCreate/onDelete有时会立即触发两次

我偶尔会在onCreate和onDelete触发器上观察到这种行为. 在此输入图像描述

两个执行都发生在firestore中创建的同一文档中.那里只有一个文档,所以我不明白它是如何触发处理程序两次的.处理程序本身很简单:

module.exports = functions.firestore.document('notes/{noteId}').onCreate((event) => {
  const db = admin.firestore();
  const params = event.params;
  const data = event.data.data();
  // empty
});
Run Code Online (Sandbox Code Playgroud)

这不会一直发生.我错过了什么?

firebase google-cloud-functions google-cloud-firestore

9
推荐指数
1
解决办法
3170
查看次数