DDE DDE - 1 year ago 309
Javascript Question

Firebase database WEB get data in JSON

It is possible to get data from Firebase database from Javascript (WEB) directly in JSON format ?

Currently I'm using this function and I must to parse all data and convert it to JSON array

firebase.database().ref('posts/').once('value', function(snap){
// Parsing obj and saving to JSON array ...

It would be nice if I can get data directly in JSON format (like in Firebase console).

Answer Source

What if you just JSON.stringify() it? Does that get you what you're looking for?

firebase.database().ref('posts/').once('value', function(snap){
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download