我正在学习Firebase云功能。我有一个看起来像这样的函数:
exports.gameLoopBeing = functions.database.ref('/tables/{pushId}/gamestarted')
.onWrite(event => {
//I want to retrieve the pushID
console.log(event.data.pushID);
});
event.data.pushID显然不起作用。如何获取pushID?我看了看文档,找不到任何东西。
对于那些不知道pushId是的人。此函数侦听/ table内元素内部所做的所有更改。例如:
ref路径中的通配符在event params对象中提供:
exports.gameLoopBeing = functions.database.ref('/tables/{pushId}/gamestarted')
.onWrite(event => {
//I want to retrieve the pushID
console.log(event.params.pushId);
});
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句