I have a problem with my Firebase DB. I have the following structure:
{
"adminroles":{
"admin1": "some_uuid"
}
}
In my file.js, I use the following code:
return firebase.database()
.ref('adminrole/')
.once('value')
.then(function(snapshot) {
var adminuser = snapshot.child('admin1').val();
});
However, the snapshot is undefined.
Could some one please help me? Is a problem with my database structure?