Slava Slava - 7 months ago 31
Javascript Question

Gettting data from firebase not woks

I init my web app with firebase, then I add new data into database: {'title': 'hello world!'}. Then I try to get this data:

and I got strange object:
enter image description here

How to get my data?
Firebase version: 3.4.0


Firebase queries are asynchronous. Hence, you need to register a callback so that Firebase can inform you when the results are ready.

Try this:

database.ref().child('title').on('value', (snapshot) => {

You may read this for more information.