set vs update firebase code example
Example 1: firebase set vs update
firebase.database().ref().child('/posts/' + newPostKey)
.set({ title: "New title", body: "This is the new body" });
Example 2: firebase update data
await firebase.database().ref().update(updates);