Write realtime table event snap with FuntionsCloud in Firebase

1

I have an instance called AP which I want to create a function that when a new data is added that data is added another instance in the same database called SA I tried unsuccessfully in the following way with the event 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);
});

I went to the google test function tool and when executing it, it completely eliminates the instance SA . Another thing that caught my attention was the registration of the function is as follows:

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

I do not know why I should add billing information, I'm really confused. I appreciate the help you can give me.

    
asked by Gabriela 08.09.2018 в 17:41
source

0 answers