Vishu
Vishu

Reputation: 35

How to access firebase database value in json format

My JSON structure is as follows-:

[how can i access this json structure for firebase realtime db, basically i want to print 
    id(numeric num), then the email_id][1]


  https://i.sstatic.net/UslTG.png

I want to read the numeric value and email and that numeric value will going to change every time and i want to read the value latestly added inside article/.?

Upvotes: 1

Views: 175

Answers (1)

Albert
Albert

Reputation: 11

How to retrive id(number- and also there is no key to read that num) and email

firebase.database().ref('/article/' + num + '/email/').on('value',function(snapshot) {
 var email = snapshot.val().email
  // ...
});

More information in: https://firebase.google.com/docs/database/web/read-and-write

Upvotes: 1

Related Questions