我在Firebase项目中使用多个数据库。用于主(默认)数据库的云函数工作很好,但是,我不能让它们为辅助数据库工作。例如,我希望在具有管理权限的节点上发出读取请求:
//this works
admin.database().ref(nodePath).once('value')...
但是,如果我想在另一个数据库上执行命令,则它不能工作:
//this doesn't work
admin.database(secondaryDatabaseUrl).ref(nodePath).once('value')...
尽管部署了这些函数,但在尝试执行云功能时
我试图导入一个大的JSON文件(177 k记录)到云防火墙,首先我发现了下面的代码;
上传代码
var admin = require("firebase-admin");
var serviceAccount = require("./service_key.json");
admin.initializeApp({
credential: admin.credential.cert(serviceAccount),
databaseURL: "my service key"
});
const firestore = a
目前,Firebase提供的开源云函数使用onwrite to Firebase数据库来触发对Stripe的计费:
看起来使用https触发器来调用Stripe会更直接、更快,而不是写到Firebase本地数据库,后者会同步/写入到Firebase服务器数据库,然后触发对Stripe的云函数调用。
使用Https调用触发条带调用会有问题吗?使用onwrite触发器而不是https有什么好处?
我正在测试firebase云函数,我很好奇如何将数据从表单传递到云函数。我已经创建了一个接受几个字段的注册表单--我的计划是使用firebase创建一个auth帐户,并在创建auth帐户时运行一个云功能。此函数将在Firestore中创建一个用户文档。
下面的代码给出了我的前端设置的一个概念。
import React from "react"
import firebase from "firebase"
// create some config for firebase
const app = firebase.initializeApp(config
在对应用程序中的用户进行身份验证后,我想创建一个云函数,该函数在我的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
我有一个Android应用程序使用Firebase数据库,认证和云功能模块。当用户通过应用程序创建配置文件并设置用户全名时,
FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
if (user != null) {
// user signed in
String displayName = user.getDisplayName();
// do whatever with displayName...
} else {
// ....
}
几乎和预期的一样--不管用户输入什么。
我正在构建一个云函数,它将使用条纹API来处理支付。这是在一个firebase项目中。当我运行firebase deploy时,我收到错误消息"Object is possible 'undefined'“const existingSource = customer.sources.data.filter( (s) => s.id === source).pop();我不确定如何解决这个问题。
这是我的getorCreateCustomer所在的xxx.ts
/** Read the stripe customer ID from firestore, or c
我想要显示数据从Firebase实时数据库到我的应用程序。我已经将它与firebase数据库集成在一起,可以在数据库中使用update,delete,create user。 我的数据库结构是这样的 schooldbproject
-class_1
1
age: 24
name:"Pheng Sengvuthy 004" 这是我用来创建db的代码: // To select data from firebase every time data has changed !
firebase.database().ref('schooldbproj