admin管理员组文章数量:1303498
How to get only changed value on Firebase Database? Because every time I changed a value on dir
, ex:
/ some_user
~ id
~ name
/ data
~ order_id
~ order_name <<= Changed in here
But when I get the changed data, I get all the tree structure and not only changed data order_name
. So I just wanted it to return something like this:
/ some_user
/ data
~ order_name <<= Specific changed data
So I can identify what is the exact key
data that has changed. How can I do this? Thanks.
How to get only changed value on Firebase Database? Because every time I changed a value on dir
, ex:
/ some_user
~ id
~ name
/ data
~ order_id
~ order_name <<= Changed in here
But when I get the changed data, I get all the tree structure and not only changed data order_name
. So I just wanted it to return something like this:
/ some_user
/ data
~ order_name <<= Specific changed data
So I can identify what is the exact key
data that has changed. How can I do this? Thanks.
1 Answer
Reset to default 7Attach the listener to the order_name reference.
var user = "Alan";
var ref = firebase.database().ref(user + "/data/order_name");
ref.on("value", function(snapshot) {
console.log(snapshot.val());
});
本文标签: javascriptHow to get only changed value on Firebase DatabaseStack Overflow
版权声明:本文标题:javascript - How to get only changed value on Firebase Database? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741759089a2396293.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论