From f26adad944c0a8c08fe573cdcbd6724f4500b08f Mon Sep 17 00:00:00 2001 From: Fabio Date: Wed, 19 Jun 2019 10:48:49 -0300 Subject: [PATCH 1/2] Update README.md I didn't changed every thing because I was afraid of messy to mush, but on your example of set and push you didn't put that the json must have the "obj". --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 25dde49..e2e7755 100644 --- a/README.md +++ b/README.md @@ -23,12 +23,12 @@ output: ## rtdb-set Set data at a path in the rtdb database. Use 'on' snapshot so will fire every time the data at the path changes and so drive flow execution from that point. -input: {payload: {path: 'foo/bar'}, {some: 'object', foo: 17}} +input: {payload: {"path": "foo/bar", "obj": {"some": "data", "foo": "17"}}} ## rtdb-push Pushes the new object onto an array under the path -input: {payload: {path: 'foo/bar'}, {some: 'object', foo: 17}} +input: {payload: {"path": "foo/bar", "obj": {"some": "data", "foo": "17"}}} ## rtdb-query Set up a reactive query for a path in the rtdb database. From 8250c7460b1fe7618c0546977d0bb038b40ea245 Mon Sep 17 00:00:00 2001 From: Fabio Date: Mon, 1 Jul 2019 12:52:20 -0300 Subject: [PATCH 2/2] Reference to "storageBucket" on init --- firebase-config.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/firebase-config.js b/firebase-config.js index 01d282b..102d859 100644 --- a/firebase-config.js +++ b/firebase-config.js @@ -6,18 +6,21 @@ module.exports = function(RED) { RED.nodes.createNode(this,n); this.cred = n.cred this.dburl = n.dburl + this.sturl = n.sturl this.admin = _admin if(!init){ console.log('setting admin....') init = true this.credentials = JSON.parse(this.cred); this.dburl = this.dburl + this.sturl = this.sturl console.log('*** parsed firebase credentials: '+this.credentials.type+', project-id: '+this.credentials.project_id) _admin.initializeApp({ credential: _admin.credential.cert(this.credentials), - databaseURL: this.dburl + databaseURL: this.dburl, + storageBucket: this.sturl }); } } RED.nodes.registerType("firebase-config", FirebaseConfigNode); -} \ No newline at end of file +}