我想将新的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
发布评论