【发布时间】:2021-06-24 05:10:00
【问题描述】:
我正在做一个颤振项目,这是我的代码:
String vl = store.reference().child("Volunteers/Aadithya").push().key;
vlRef = FirebaseDatabase.instance.reference().child("Volunteers/Aadithya");
vlRef.child(vl).update({
"Contributions": int.parse(count)+1,
}).then((_) {
}).catchError((onError) {
Scaffold.of(context)
.showSnackBar(SnackBar(content: Text(onError)));
});
Contributions 是Aadithya 内部的一条数据记录。我需要单独更新它的值。但实际情况是,在 Aadithya 中创建了一个新的子记录,contributions 是它的数据类型
请帮忙:
【问题讨论】:
-
你能分享一下你的数据库结构的截图吗?
-
当然。我已经更新了
-
嘿,我已经发布了答案。如果这对您有帮助,您可以通过单击对勾图标接受它,这样其他人就会知道它已解决,否则请随时提出进一步的问题。
标签: firebase flutter dart firebase-realtime-database