Retrieving data from my real time database on firebase

Viewed 34

Hello I am trying to retrieve my data in my database. My data is in this path https://(MYLINK).firebaseio.com/users/personalID Inside of this directory I have a lot of data in generated keys. I Want to be able to access them and query through them. But I am having trouble just retrieving a JSON of data.

admin.initializeApp(firebaseConfig)
        var db = admin.database();
        var users = db.ref('users/B72O-UB2J-51KJ-JUIX')
        users.orderByKey().on('value', snapshot =>{
            console.log(snapshot.val())
        })

Nothing happens when I run this code. Any suggestions ??

I tried to show how my data is structured and stored

1 Answers

My issue was I wasn't importing the correct config to run the administrator app. You can go to your app settings and then they have a config section with all the info.

Related