【发布时间】:2019-05-16 10:58:42
【问题描述】:
我正在使用云功能来监听在 Firestore 上创建的新文档。
functions.firestore.document('users/{userId}')
.onCreate((snapshot, context) => {
console.log('params', context.params.userId);
});
日志显示 undefined 而不是通配符参数。
从 2018 年 12 月 15 日午夜开始。
这是与 Firestore/云功能更新有关的错误吗? 以及我们如何绕过这个问题?
【问题讨论】:
-
昨晚我们也开始遇到这种情况。可能的解决方法是使用快照对象中的 ID,例如
const userId = snapshot.id; -
现在有一个 Github 问题:github.com/firebase/firebase-functions/issues/357
-
似乎此问题已发布在 Firebase 的状态仪表板中。 : status.firebase.google.com/incident/Functions/18044
标签: google-cloud-firestore google-cloud-functions