How do Firebase and Pyrebase work

How do I get data from the Firebase database?

Python Firebase Real-Time Database CRUD Tutorial # 4 - Retrieve Data [Pyrebase]

I'm trying to create a simple program that will take the user's name, cell phone number, and email address and then put the data in the Firebase real-time database.

There are 3 input fields and a button that, when clicked, will perform the above process. Here is the code:

I set up Firebase as follows:

And here is my function:

This is how I put data in a database that works.

So which generates a string, it works fine when pasting, but how do you get it now? The official documentation doesn't help. This generated string may be based on a timestamp. If this is the case, regeneration is not possible.

When retrieved, how do I get access to email, cell phone and name under this uniquely generated string that was only available at the time of insertion?

Following the structure above, I need to go down two levels to access the data I need. Due to the lack of documentation, I don't know how to do this. I'm not sure if something like this works:

  • 1 what does produce in the console?
  • 3 @Deryck generates 'undefined'.

The answer to this question is buried deep in the Firebase database reference. is used to get to the child without knowing the child's exact path.

Now contains the necessary data, the same thing can also be accessed with.

The only difference is that in the case of It loops from the beginning. So when new data is added, the previous data is also loaded, but in the case of the listener is only on a new child and not on the previous existing children.

  • Very helpful. Many Thanks.
  • 2 I really wish this was in the standard documents. Buried deep!
  • Firebaser here There is also a section on eavesdropping on value events with an example of this in the documentation guides. I would like to know what search terms people are using when they land here so we can use those in the documentation too.
  • @FrankvanPuffelen "I'd like to know what search terms people are using when they land here": firebase retrieves data javascript

You can also use dot notation to find the value of the child you are looking for.

Below, I just commented out the forEach loop from the highest rated answer and added a console.log ().

At the time of publication, I'm using Firebase 5.9.1

src = "https://www.gstatic.com/firebasejs/5.9.1/firebase.js"

I faced the same problem. I wanted to read the data from the Firebase real-time database and print it on the web. The data I'm reading is in the test document. Use the function to take the snapshot of it. Firebase gives you a foreach loop that you can use to iterate over the data in the test document. The variable reads the value during the loop. The location of the variables,, are the keys in the test document.

are the DOM element for printing the data on the web

I hope this helps someone.