This particular question is similar to question 44799104, but the difference lies in my inclusion of index.js (and the sole answer provided there was not helpful, even though I have included 'exports').
In summary, I have successfully deployed my function,
https://i.sstatic.net/8038s.png
However, it does not appear in the console. Can someone point out where I might be making a mistake? Below is my index.js:
const functions = require('firebase-functions');
const admin - require('firebase-admin');
admin.initializeApp(functions.config().firebase);
var delayInMilliseconds = 5000;
exports.copyRoom = functions.database.ref('/RoomsOwn/${AuthUid}').onWrite((event) => {
var uid = event.params.AuthUid;
console.log('AuthID: ' + uid);
var object = event.data.val();
console.log('Whole Object: ', object);
setTimeout(function() {
return admin.database.ref('/RoomsOthers/${uid}').set(object);
}, delayInMilliseconds);
});