【发布时间】:2020-12-19 15:38:27
【问题描述】:
数据样本
database
|__news
|__category1
| |
| |__post1
| | |__text: "Lorem ipsum 1"
| | |__title: "Title of post1"
| |__post2
| | |__text: "Lorem ipsum 2"
| | |__title: "Title of post2"
| |__description: "description text"
| |__id: "id of category"
| .
| .
|
|__category2
| |
| |__post34
| | |__text: "Lorem ipsum 34"
| | |__title: "Title of post34"
| .
| .
现在我有一个在 Firebase 中创建数据的简单函数是:
void createRecord() {
databaseReference.child("post1").set({
'text': 'Mastering EJB',
'title': 'Programming Guide for J2EE'
});
我的问题是我想在=>news->category1>[posts] 添加数据
那么我应该怎么做才能迭代到post1
【问题讨论】:
标签: android firebase flutter dart firebase-realtime-database