how to read pushed data realtime database code example
Example 1: add to firebase database
db.collection("cities").add({
name: "Tokyo",
country: "Japan"
})
.then(function(docRef) {
console.log("Document written with ID: ", docRef.id);
})
.catch(function(error) {
console.error("Error adding document: ", error);
});
Example 2: write firebase data using variables javascript
foo = {};
foo[variable] = 'more stuff';
fb.set(foo);