云修复-云函数:TypeError: collectionRef.child不是一个函数
我正在使用Cloud函数来更新Cloud的父集合中的注释号,所以当注释添加时,云函数可以自动更新注释号。
云修复-云函数:TypeError: collectionRef.child不是对象上的函数(/user_code/index.js:23:33)。(/user_code/node_modules/firebase-functions/lib/cloud-functions.js:112:27) at next (原生) at /user_code/node_modules/firebase-fun
我正在创建我的第一个云函数,它简单地将子集合journal中的文档复制到子集合activites中。我希望复制的文档具有相同的postId。函数日志显示
Error: Value for argument "documentPath" is not a valid resource path. Path must be a non-empty string.
at Object.validateResourcePath (/workspace/node_modules/@google-cloud/firestore/build/src/path.js:406:15)
at Co
我试图更新DocumentReference,但做不到。
update()方法失败。怎么用?(如何传递参数?)
firebase-admin版本为6.3.0。
@google-cloud/firestore版本为0.19.0。
❯ firebase functions:shell
i functions: Preparing to emulate functions.
Warning: You're using Node.js v8.14.0 but Google Cloud Functions only supports v6.11.5.
✔ functions: sampleF
更多解释:
在iOS上创建文档。它包含一个城市和一个类型。
在CloudFunctions中,我通过onWrite触发器检测文档的创建/更新。
我想查询符合City +类型标准的用户的其他FireStore文档。那我就给他们发通知。
这是我的代码:
exports.NewRequestCreated = functions.firestore.document('/Requests/{documentId}').onWrite(event => {
// Get an object with the current document value
va
在exports.onDataAdded.functions.database.ref.onCreate.event (/user_code/index.js:5:28)处,TypeError:无法读取未定义的属性'val‘。(/user_code/node_modules/firebase-functions/lib/cloud-functions.js:112:27) at next (原生) at /user_code/node_modules/firebase-functions/lib/cloud-functions.js:28:71 at __awaiter (/user
每次创建和删除帐户时,我都会尝试记录。
我创建了一个触发器functions.auth.user().onCreate(),据我所知,它返回一个user对象,如文档中的:,。
函数的部署没有问题,但是当调用触发器时,它会抛出一个错误:
Error: Process exited with code 16
at process.<anonymous> (/layers/google.nodejs.functions-framework/functions-framework/node_modules/@google-cloud/functions-framework/build/sr
在试图运行云功能时,我收到了以下错误:
TypeError: admin.firestore.doc is not a function
at exports.handler.functions.firestore.document.onCreate (/user_code/trackVote.js:10:57)
at Object.<anonymous> (/user_code/node_modules/firebase-functions/lib/cloud-functions.js:112:27)
at next (native)
at /user_code/node_mod
这是从Firebase的文档中复制的:-
评论说,监听器将监听“用户”和所有子集合中的所有文档。
我怎么能只监听子集合的所有文档,而不监听父集合?(即在本例中,不要监听“users”中的文档。)
// Listen for changes in all documents in the 'users' collection and all subcollections
exports.useMultipleWildcards = functions.firestore
.document('users/{userId}/{messageCollectionId
在对应用程序中的用户进行身份验证后,我想创建一个云函数,该函数在我的firestore userProfile集合中为用户创建一个用户配置文件文档。
这是我用于云函数的整个index.js文件
// The Cloud Functions for Firebase SDK to create Cloud Functions and setup triggers.
const functions = require('firebase-functions');
// The Firebase Admin SDK to access the Firebase Realtime D
我正在尝试部署一个云函数,每当在我的Firestore中创建一个新文档时,它就会更新Algolia搜索索引。一切看起来都很好,但在最后,它出错了。我已经看过这些文档,感觉语法是正确的,所以我不知道现在该做什么。云函数日志没有指向任何东西,只是重复了我在下面收到的错误
错误消息:
=== Deploying to 'test-ffdbb'...
i deploying functions
i functions: ensuring necessary APIs are enabled...
i runtimeconfig: ensuring necessary APIs
我正在尝试设置一个firebase函数,在文档被删除时删除文档的所有子集合。通过阅读我已经读到的文档,:
// The Cloud Functions for Firebase SDK to create Cloud Functions and setup triggers.
const functions = require('firebase-functions');
// // Create and Deploy Your First Cloud Functions
// // https://firebase.google.com/docs/functions/w
在编写一个在创建用户时触发的简单示例函数时出现以下错误。
代码:
exports.createUser = functions.firestore
.document('users/{userId}')
.onCreate((snap, context) => {
const newValue = snap.data();
const name = newValue.name;
//....do some stuff here
});
错误描述:
Error: Cloud function needs to be called with
在尝试使用云函数仿真器时,我收到一条消息,指出: function ignored because the firestore emulator does not exist or is not running 我试着在这里提到:(Firestore/Firebase Emulator Not Running)。 我的函数/package.json如下所示: {
"name": "functions",
"description": "Cloud Functions for Firebase",
"scrip