Geo*_*oub 3 firebase google-cloud-functions firebase-admin
我正在学习firebase云功能.我有一个看起来像这样的功能:
exports.gameLoopBeing = functions.database.ref('/tables/{pushId}/gamestarted')
.onWrite(event => {
//I want to retrieve the pushID
console.log(event.data.pushID);
});
Run Code Online (Sandbox Code Playgroud)
event.data.pushID显然不起作用.如何检索pushID?我查看了文档但找不到任何内容.
对于那些不知道pushId的人.此函数侦听/ table内元素内所做的每个更改.例如:
ref路径中的通配符在事件params对象中提供:
exports.gameLoopBeing = functions.database.ref('/tables/{pushId}/gamestarted')
.onWrite(event => {
//I want to retrieve the pushID
console.log(event.params.pushId);
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1027 次 |
| 最近记录: |