0
exports.respublished =
functions.database.ref('/Posts/{postid}').onWrite(event => {
const snapshot = event.data;
const postid = event.params.examid;
const uid = snapshot.child('uid').val();
const ispublic = snapshot.child('Public').val();
firebase.database.ref('Users/' + uid).once(event => {
const snapshot = event.data;
const name = snapshot.child('name').val();
});
});
이벤트는 다른 노드에 의해 트리거되고 firebase 데이터베이스의 다른 노드에서 데이터를 검색하려고합니다. 위 코드를 시도했지만 TypeError : firebase.database.ref (...) 오류가 발생합니다. once는 함수가 아닙니다.Cloud Base에서 firebase 데이터베이스의 노드 값을 얻는 방법
를 사용할 수있는 대답을 얻었다? 'firebase.database.ref(). once '를 의미합니까? 그렇다면'firebase'은 무엇입니까? 다른 곳에서 정의 해 봤어? –