在对应用程序中的用户进行身份验证后,我想创建一个云函数,该函数在我的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
我正在学习教程,尝试将一些函数部署到Firebase,并且我可以成功地将它们部署到我的项目id中。在访问提供的URL上的下列函数时,我得到错误:无法处理请求
// 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 Database.
const a
在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
我的函数由数据库事件触发,并使用Firebase Cloud消息传递向主题发送通知。我的第一个函数运行良好,但是第二个函数一直抛出这个错误:
2018-02-20T21:16:49.878Z E receiveMessage: TypeError: admin.messaging(...).send is not a function
at exports.receiveMessage.functions.database.ref.onCreate (/user_code/index.js:55:27)
at Object.<anonymous> (/user_code/node_
我在我的应用程序中实现了firebase函数,以前它运行良好,但现在它显示错误,无法读取未定义的的“以前”属性。
函数错误日志
TypeError: Cannot read property 'previous' of undefined
at exports.LoveNotification.functions.database.ref.onWrite (/user_code/index.js:223:16)
at cloudFunctionNewSignature (/user_code/node_modules/firebase-functions/lib/cloud-f
我正在尝试运行一些使用云函数在Firestore服务器中存储随机数据的示例代码,但是,cloud functions deploy命令拒绝构建命令:
// Package p contains an HTTP Cloud Function.
package p
import (
//...
firebase "firebase.google.com/go"
"log"
"net/http"
"os"
)
// Store1 Stores data on FireBase
func Sto
更多解释:
在iOS上创建文档。它包含一个城市和一个类型。
在CloudFunctions中,我通过onWrite触发器检测文档的创建/更新。
我想查询符合City +类型标准的用户的其他FireStore文档。那我就给他们发通知。
这是我的代码:
exports.NewRequestCreated = functions.firestore.document('/Requests/{documentId}').onWrite(event => {
// Get an object with the current document value
va
我试图迭代我认为是Map对象的元素,并得到以下错误: TypeError: cr.forEach is not a function
at exports.onNewOrder.functions.database.ref.onCreate.event (/user_code/index.js:122:12)
at Object.<anonymous> (/user_code/node_modules/firebase-functions/lib/cloud-functions.js:112:27)
at next (native)
at /user_co
我正在运行一个firebase云函数和一个firebase firestore。尝试将GeoPoint实例存储到firestore时,firebase上记录了以下错误:
Error: Argument "data" is not a valid Document. Detected an object of type "GeoPoint" that doesn't match the expected instance. Please ensure that the Firestore types you are using are from the s
谢谢你,我正在部署一个函数来限制从推送command.The链接生成的子节点,我正在遵循,现在我正在编辑这个代码,将我的自定义代码放在下面的链接中:
'use strict';
const functions = require('firebase-functions');
// Max number of lines of the chat history.
const MAX_LOG_COUNT = 1;
// Removes siblings of the node that element that triggered the functi
按照我的建议,当新用户在使用Firebase Cloud Functions进行身份验证之前注册时,我会尝试在数据库中查找重复的用户名,因为本地的.queryEqual(toValue)不会每次都起作用。我现在想不通的是如何在我的应用程序中使用它。下面是我部署的云函数:
// The Cloud Functions for Firebase SDK to create Cloud Functions and setup triggers.
const functions = require('firebase-functions');
// The Firebase Admi
这个功能是给用户通知,当有人向他发送请求时,我正在创建一个用于学习的消息应用程序,但无法解决问题。firebase控制台一直给出错误: firebase函数
TypeError: Cannot read property 'receiver_id' of undefined
at exports.sendNotification.functions.database.ref.onWrite.event
(/user_code/index.js:9:36)
at Object.<anonymous> (/user_code/node_modules/fireb
我正在使用node.js处理Firebase通知。编译后,当我向app的其他用户发送请求(请求发出通知)时,firebase日志显示错误:
在exports.sendNotification.functions.database.ref.onWrite.event (/user_code/index.js:12:36)处,TypeError:无法读取未定义的属性“receiver_id”。(/user_code/node_modules/firebase-functions/lib/cloud-functions.js:112:27) at next (原生) at /user_code/n
我在Firebase函数服务中有一个发送任何FCM的函数。我会使用admin.messaging().send()函数,比如,但是在触发函数时,而不是在部署期间,我得到了这个错误:
TypeError: admin.messaging(...).send is not a function
at exports.sendChatNotification.functions.database.ref.onCreate.event (/user_code/lib/index.js:113:30)
at Object.<anonymous> (/user_code/node_
我已经部署了一个Cloud函数来更新一些聚合数据,但是
错误:无法从修复值中解码类型:{"integerValue":"3"}在exports.aggregateReceivedRatings.functions.firestore.document.的DocumentSnapshot.get (/user_code/node_modules/firebase-admin/node_modules/@google-cloud/firestore/src/document.js:372:17) at DocumentSnapshot._decodeValue D
我试图通过使用sendNotification和firebase函数来创建一个node.js函数,但不幸的是,我目前陷入了困境。我从未收到发件人的通知,当我查看Firebase函数日志时,我看到一个错误:
ReferenceError: context is not defined
at exports.sendNotification.functions.database.ref.onWrite.event (/user_code/index.js:9:32)
at Object.<anonymous> (/user_code/node_modules/firebase-func
云修复-云函数: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
在试图运行云功能时,我收到了以下错误:
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
因此,我想把通知从一个设备推送到另一个设备,我使用的是防火墙云函数,当然,在我搜索的时候,我发现有一种新的方法可以从消防站检索id,但是无论如何,没有人很好地解释了--这里是node.js index.js,我得到了以下错误:
TypeError: Cannot read property 'pharmacien_id' of undefined
at exports.sendCommandes.functions.firestore.document.onWrite.event (/user_code/index.js:8:35)
at Object.<anony