【问题标题】:How to get `Cloud Functions shell` work with Firestore如何让“Cloud Functions shell”与 Firestore 一起使用
【发布时间】:2017-10-16 08:40:29
【问题描述】:

跑步:

firebase experimental:functions:shell

当我尝试这样调用我的函数时:

sendEmail('data', {params: 'commentId:12'})

我明白了:

Info: Function crashed TypeError: Cannot use 'in' operator to search for 'exists' in data

如何在Firestore 触发的云函数上启动新的 onWrite

【问题讨论】:

  • 不幸的是,似乎还没有记录在本地测试 firestore 函数,但我认为问题是您必须以正确的格式提供测试数据,而不是使用字符串。由于 Firestore 文档本质上是 JSON 对象,您可以尝试使用类似 sendEmail({test: 'data'}, {params: {commentId:12}})
  • 我尝试了多种不同的方式测试 Firestore 功能,但它们总是以崩溃告终。我怀疑它还不支持。我在内部向 Firebase 团队提出了这个问题。

标签: firebase google-cloud-functions google-cloud-firestore


【解决方案1】:

使用 Firebase CLI 的 3.15.1 版本,您现在可以使用 run Firestore functions locally

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-09-04
    • 2019-05-18
    • 2021-02-23
    • 2020-03-26
    • 2018-11-21
    • 2018-09-15
    • 2020-11-11
    • 1970-01-01
    相关资源
    最近更新 更多