firebase realtime database delete data code example
Example 1: firestore javascript delete document
var docRef = Firebase.firestore().collection("Rooms").doc("bsYNIwEkjP237Ela6fUp").collection("Messages");
docRef.doc("lKjNIwEkjP537Ela6fhJ").delete();
Example 2: javascript write to firebase
function writeUserData(userId, name, email, imageUrl) {
firebase.database().ref('users/' + userId).set({
username: name,
email: email,
profile_picture : imageUrl
});
}
Example 3: firebase update data
await firebase.database().ref().update(updates);