Problem
I am trying to retrieve data off of my firevase server, and the reference code I am using to do so doesn't retrieve anything.
getItems(){
var items = [];
var query = firebase.database().ref('users').child(expoID).orderByKey();
query.once('value', (snap) => {
var items = [];
snap.forEach( (child) => {
items.push({
content: child.val().content,
postKey: child.val().okey,
color: child.val().color,
notifKey: child.key
});
});
items.reverse();
}).then(() => {
this.setState({firebaseItems: items});
});
}
expoID is a predefined variable, defined with expo's constants.
Server
The first items under users is the expoID seen in the code above. I tested, and its the same ID.