-2
안녕하세요 여러분, 어떻게 이런 종류의 DB 구조를 요청할 수 있습니까?React-native : Firebase 모든 데이터를 가져 오는 방법
나는 이것을 시도했지만 작동하지 않습니다 :
var recentPostsRef = firebase.database().ref('/store');
안녕하세요 여러분, 어떻게 이런 종류의 DB 구조를 요청할 수 있습니까?React-native : Firebase 모든 데이터를 가져 오는 방법
나는 이것을 시도했지만 작동하지 않습니다 :
var recentPostsRef = firebase.database().ref('/store');
당신은 바른 길에 있지만, .then()
콜백으로 사용되는 검색 부분이 누락 :
var recentPostsRef = firebase.database().ref('/store');
recentPostsRef.once('value').then(snapshot => {
// snapshot.val() is the dictionary with all your keys/values from the '/store' path
this.setState({ stores: snapshot.val() })
})
을
firebase.database.Reference
설명서에는 좋은 예제와 설명이 많이 있습니다.
굉장하고 감사합니다. Pat :) –