[英]How to update the value of a key in firebase Realtime database (JavaScript)
I want to update the value of the key on firebase Realtime Database but I was not able to update the value my database structure is like this.我想更新 firebase 实时数据库上的键值,但我无法更新我的数据库结构的值是这样的。
{ BoardID:23df2365k87 //want to update the value of BoardID }
This is the code I am trying这是我正在尝试的代码
let BoardID = app.ref('BoardID'); app.ref('/BoardID').on('value', (snapshot) =>{ console.log(snapshot.val()) let bordid = snapshot.val(); console.log(bordid); BoardID.val().update({ 'Null' }); })
I have change the code like this我已经改变了这样的代码
app.ref("/BoardID").set('two');
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.