Just delving into the world of Firebase Functions for the first time using Typescript. I've written two functions:
export const helloWorld = functions.https.onRequest((request, response) => {
response.send("Hello from Firebase!");
const testRef = admin.database().ref("test");
return testRef.set(true);
});
export const testRef = functions.database.ref("test").onWrite((event) => {
console.log("Event: " + JSON.stringify(event))
const testRef = admin.database().ref("test");
return testRef.set(true);
});
helloWorld
executes as expected when I visit the relevant URL. However, testRef
does not activate when I add or modify data at the "test" location in the root of Firebase. What could be causing this issue?