firebase

child_added gets triggered after remove

两盒软妹~` 提交于 2021-02-20 18:50:48
问题 I've created this handler to watch for new children being created. This little trick stops the child_added event from triggering my code on each page load. Instead it only gets triggered when something is actually added. // Listen for new rooms being created var first_room_added_after_load = true; this._roomRef.endAt().limit(1).on('child_added', function(snapshot){ if (first_room_added_after_load) { // we want to skip the first room, because it will already exist first_room_added_after_load =

Firebase cloud functions bundled with webpack?

倾然丶 夕夏残阳落幕 提交于 2021-02-20 10:16:55
问题 I've been stuck for a while trying to make a webpack build for my cloud functions files. My project structure: ROOT - FUNCTIONS - DIS - bundle.js // THIS SHOULD BE GENERATED BY WEBPACK - SRC - myCloudFunction.js // SOURCE CODE FOR A CLOUD FUNCTION - entryPoint.js // ENTRY POINT FOR WEBPACK - index.js - package.json - SRC - App.js .babelrc firebase.json webpack.prod.js // THIS BUILDS FOR CLIENT (WORKING FINE) webpack.server.js // THIS SHOULD BUILD FOR THE SERVER (NOT WORKING) My goal is: Write

Firebase cloud functions bundled with webpack?

≡放荡痞女 提交于 2021-02-20 10:16:49
问题 I've been stuck for a while trying to make a webpack build for my cloud functions files. My project structure: ROOT - FUNCTIONS - DIS - bundle.js // THIS SHOULD BE GENERATED BY WEBPACK - SRC - myCloudFunction.js // SOURCE CODE FOR A CLOUD FUNCTION - entryPoint.js // ENTRY POINT FOR WEBPACK - index.js - package.json - SRC - App.js .babelrc firebase.json webpack.prod.js // THIS BUILDS FOR CLIENT (WORKING FINE) webpack.server.js // THIS SHOULD BUILD FOR THE SERVER (NOT WORKING) My goal is: Write

Cloud Functions for Firebase iterate through a child node

扶醉桌前 提交于 2021-02-20 09:09:29
问题 I just started to use firebase Functions and I am new to the node.js environment, can somebody tell how to iterate through a child node and get the child values. 回答1: see this example: const parentRef = admin.database().ref("path"); return parentRef.once('value').then(snapshot => { const updates = {}; snapshot.forEach(function(child) { updates[child.key] = null; }); return parentRef.update(updates); }); 回答2: Have you looked through the Cloud Functions for Firebase Samples? They contain many

Cloud Functions for Firebase iterate through a child node

别说谁变了你拦得住时间么 提交于 2021-02-20 09:06:08
问题 I just started to use firebase Functions and I am new to the node.js environment, can somebody tell how to iterate through a child node and get the child values. 回答1: see this example: const parentRef = admin.database().ref("path"); return parentRef.once('value').then(snapshot => { const updates = {}; snapshot.forEach(function(child) { updates[child.key] = null; }); return parentRef.update(updates); }); 回答2: Have you looked through the Cloud Functions for Firebase Samples? They contain many

Can Cloud Functions for Firebase be used across projects?

為{幸葍}努か 提交于 2021-02-20 06:16:23
问题 I was hoping to trigger a Pub/Sub function (using functions.pubsub / onPublish) whenever a new Pub/Sub message is sent to a topic/subscription in a third-party project i.e. cross projects. After some research and experimentation I found that TopicBuilder throws an error if the topic name contains a / and it defaults to "projects/" + process.env.GCLOUD_PROJECT + "/topics/" + topic (https://github.com/firebase/firebase-functions/blob/master/src/providers/pubsub.ts). I also found a post in Stack

Can Cloud Functions for Firebase be used across projects?

血红的双手。 提交于 2021-02-20 06:14:34
问题 I was hoping to trigger a Pub/Sub function (using functions.pubsub / onPublish) whenever a new Pub/Sub message is sent to a topic/subscription in a third-party project i.e. cross projects. After some research and experimentation I found that TopicBuilder throws an error if the topic name contains a / and it defaults to "projects/" + process.env.GCLOUD_PROJECT + "/topics/" + topic (https://github.com/firebase/firebase-functions/blob/master/src/providers/pubsub.ts). I also found a post in Stack

Can Cloud Functions for Firebase be used across projects?

萝らか妹 提交于 2021-02-20 06:14:29
问题 I was hoping to trigger a Pub/Sub function (using functions.pubsub / onPublish) whenever a new Pub/Sub message is sent to a topic/subscription in a third-party project i.e. cross projects. After some research and experimentation I found that TopicBuilder throws an error if the topic name contains a / and it defaults to "projects/" + process.env.GCLOUD_PROJECT + "/topics/" + topic (https://github.com/firebase/firebase-functions/blob/master/src/providers/pubsub.ts). I also found a post in Stack

Clear Firestore database of all data?

大兔子大兔子 提交于 2021-02-20 06:03:33
问题 After over a year of development, I have a pretty well developed site. Now I'm going to open it up for a public beta but I need to clear my Firestore of all it's data (it's all test data). Is there a simple way to do this or do I have to delete every single entry by hand? (There are over 1000 entries). The only realistic option I can think of at the moment is to switch Firebase projects to a new one, which is not something I want to do. Solution : After reaching out to Firebase support, I was

Clear Firestore database of all data?

天大地大妈咪最大 提交于 2021-02-20 06:02:56
问题 After over a year of development, I have a pretty well developed site. Now I'm going to open it up for a public beta but I need to clear my Firestore of all it's data (it's all test data). Is there a simple way to do this or do I have to delete every single entry by hand? (There are over 1000 entries). The only realistic option I can think of at the moment is to switch Firebase projects to a new one, which is not something I want to do. Solution : After reaching out to Firebase support, I was