update new attribute into exists node firebase(realtime database) (edit)

Viewed 26

I'm a newbie in firebase realtime database. i have got a data structures as below. How can i update a new property (TimeOut) at the same node without loss current properties?

enter image description here

has someone, he was supported me to update a new property with below method

firebase.database().ref('18-9/Working/TimeOut').set('5:20:30');
OR
firebase.database().ref('18-9/Working').update({ TimeOut: '5:20:30' });

, but it's still doesn't work, maybe my syntax was wrong.

I would appreciate it if someone could help me this issue

enter image description here

1 Answers

Firebase Realtime Database and Cloud Firestore are different databases. In this case, you are using RTDB but importing the Firestore SDK. Adding the Realtime DB SDK should resolve the issue:

import "firebase/compat/database"
Related