![](/img/trans.png)
[英]Firestore functions onUpdate doesn't trigger with nested object change
[英]How to access firestore data in functions onUpdate
我的数据:
我的firestore功能:
const functions = require('firebase-functions');
const admin = require('firebase-admin');
admin.initializeApp();
exports.onMessageCreate = functions.firestore
.document('users/{userId}')
.onUpdate((change, context) => {
console.log(change.after.ref.parent);
所以我想访问users
集合,但我得到:
TypeError: change.after.ref.parent is not a function
我猜您需要在用户之前使用 / ,如下所示。
.document('/users/{userId}')
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.