Firebase functions 1.0 event.params.pushId, event.data.ref



https://firebase.google.com/docs/functions/beta-v1-diff

在文档中找不到event.params.pushIdevent.data.ref

event.params.pushIdevent.data.ref已更改为:

exports.dbWrite = functions.database.ref('/path/with/{pushId}').onWrite((change, context) => {
const wildcards=context.params.pushId;
const data=change.after.ref;
});

对于OnWrite和Onupdate事件,数据参数具有beforeafter字段。这些都是DataSnapshot,此处具有相同的方法:

https://firebase.google.com/docs/reference/admin/node/admin.database.datasnapshot

refDataSnapshot的属性之一,因此您可以如上所述访问。

检查以下内容:

https://firebase.google.com/docs/functions/beta-v1-diff#realtime-database

最新更新