like:
users/
users/id
messages
messages/id
Just like WP, but way more flexible. A tricky thing is that you can change the structure at any time, even by accident :)
https://console.firebase.google.com/u/0/
Copy the code to your html file
Beware, this is not recommended for production, a database without authentication is a really bad idea
In our JS file, get a reference to the database
const database = firebase.database();
https://firebase.google.com/docs/database/web/read-and-write?authuser=0
database.ref(path).push(obj)
e.g.
database.ref('users/').push({name:"Jonas", email: "jofh[at].kea.dk"})
Using .set()
overwrites data at the specified location, including any child nodes.
database.ref(path).set(data);
e.g.
database.ref('users/someid').set({name: "Jonas Holbech", email:"jofh[at].kea.dk"});
https://firebase.google.com/docs/database/web/lists-of-data?authuser=0#listen_for_child_events
database.ref(path).on(event, callback)
e.g.
database.ref('users/').on('child_added', snapshot=>{
const key = snapshot.key;
const data = snapshot.val();
});
Deletes an "endpoint" and all children
database.ref(path).remove();
e.g.
database.ref('users/someid').remove()