简体   繁体   English

未调用 Firestore 触发器

[英]Firestore trigger is not being called

I have a firestore set up like this:我有一个这样的firestore:

Firestore 树状结构图

And i call onUpdate as explained in Cloud Firestore triggers docs.我按照 Cloud Firestore 触发器文档中的说明调用 onUpdate。

functions.firestore.document(`users/{userId}`).onUpdate((change, context) => {
    console.log("it's working")
});

I click on button to increase the balance but nothing gets logged (the balance gets increased though.)我单击按钮以增加余额,但没有记录任何内容(尽管余额增加了。)

What am i doing wrong?我究竟做错了什么?

When you create a Cloud Function Trigger, you should see its presence inside your Firebase Console.创建 Cloud Function 触发器时,您应该会在 Firebase 控制台中看到它的存在。 If it is not there, then it is not being exported which is a requirement for it to being triggered.如果它不存在,那么它就不会被导出,这是触发它的必要条件。

exports.myFunction = functions.firestore...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM