我有一个名为AP的实例,我想创建一个函数,当添加新数据时,将数据添加到同一数据库中称为SA的另一个实例中,但我使用onCreate事件以下列方式尝试失败了
const functions = require('firebase-functions');
const admin = require('firebase-admin');
exports.addSa = functions.database
.ref('AP')
.onCreate((snapshot, context) => {
const datos = snapshot.val();
return snapshot.ref.parent.child('SA').set(datos);
});
我去了google测试功能工具,执行它时所执行的操作是它完全删除了SA实例。引起我注意的另一件事是该函数的注册如下:
11:31:54.521 a.m.
addSa
Function execution took 1658 ms, finished with status: 'ok'
====
11:31:52.916 a.m.
addSa
Billing account not configured. External network is not accessible and quotas are severely limited. Configure billing account to remove these restrictions
====
11:31:52.916 a.m.
addSa
Function execution started
我真的在学习JS和Firebase的路上,我不知道为什么要添加帐单信息,我真的很困惑。感谢您能给我的帮助。