Cloud Functions中的Cloud Firestore

编程入门 行业动态 更新时间:2024-10-28 08:25:17
本文介绍了Cloud Functions中的Cloud Firestore的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想将新的Cloud Firestore集成到我的Cloud Functions中.

I want to integrate the new Cloud Firestore to my Cloud Functions.

我更新了node.js并在Mac上安装了最新的Firebase版本.

I updated node.js and installed the latest firebase version on my mac.

文档说:

exports.myFunctionName = functions.firestore .document('users/marie').onWrite((event) => { // ... Your code here });

应该工作.就像所有其他实时数据库功能一样,我只是复制了代码并将其粘贴到index.js中.当我部署功能代码($ firebase deploy --only功能)时,出现此错误:

should work. I just copied the code and pasted it into the index.js, like every other realtime database functions. When I deploy the function code ($firebase deploy --only functions), i get this error:

Cannot read property 'document' of undefined at Object.<anonymous> (/private/var/folders/zm/wp2415l929s472jv7kzbt3km0000gn/T/fbfn_21520Y4xqAJosBNHe/index.js:196:45) at Module._compile (module.js:570:32) at Object.Module._extensions..js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12)

关于这个问题有什么建议/想法吗?

Any suggestions/ideas on the problem?

推荐答案

好的,我尝试了所有这些事情,但是没有成功.但是firebase带来了一个更新,现在可以了:)

Alright, i tried all these things, but it didn't work out. But firebase brought out an update, now it works :)

似乎他们有一些错误.

感谢您的帮助!

更多推荐

Cloud Functions中的Cloud Firestore

本文发布于:2023-11-22 05:13:48,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1616103.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Cloud   Functions   Firestore

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!