【发布时间】:2018-10-24 16:54:30
【问题描述】:
Firestore 云函数优先级
现在我在 Firestore 数据库中部署了两个云函数。
它们是由相同的文档更改触发的。
是否可以指定函数的执行顺序或触发顺序?比如我想让updateCommentNum函数触发拳头,然后触发writeUserLog函数。我怎样才能实现这个目标?
exports.updateCommentNum = functions.firestore
.document('post/{postId}/comments/{commentsID}')
.onWrite((change, context) =>
{
//update the comment numbers in the post/{postId}/
}
exports.writeUserLog = functions.firestore
.document('post/{postId}/comments/{commentsID}')
.onWrite((change, context) =>
{
//write the comment name,text,ID,timestamp etc. in the collection "commentlog"
}
【问题讨论】:
标签: javascript firebase google-cloud-firestore google-cloud-functions