Update a value in firebase

PHOTO EMBED

Sat Jun 05 2021 11:01:04 GMT+0000 (UTC)

Saved by @nerdydave #javascript

database.ref('message').child('key').update({text: 'This is my updated text!'})

database.ref('message').child('key').set({text: 'This is my updated text!'})
content_copyCOPY

This can be useful, when wanting to update an existing value in firebase. Not that the object, which is being passed, only contains the updated value. No need for typing the values, which stay the same. When set() is being used the whole object will be updated.