В приведенном ниже коде:
exports.sendRequestNotification = functions.database.ref('/Notifications/{notificationid}/longitude').onWrite((event) => {
const lat = admin.database().ref('/Users/B8r1Xc8cAOVGOiptlFOz45fzxSm1');
return Promise.all([lat]).then((results) =>{
const latitud = results[0];
console.log('hi ',latitud.data.child('name').val());
});
});
Я пытаюсь получить имя конкретного пользователя и выйти из него, но это дает мне эту ошибку:
TypeError: Cannot read property 'child' of undefined
at Promise.all.then (/user_code/index.js:60:35)
at process._tickDomainCallback (internal/process/next_tick.js:135:7)
Я попробовал решение в этом сообщении, и оно тоже не сработало (Доступ db в Cloud Functions for Firebase)
Может кто-то мне помочь, пожалуйста?