【发布时间】:2017-10-19 05:30:50
【问题描述】:
我正在使用 angularfire2 将数据存储在 firebase 数据库中。我需要将数据添加到存储在数据库中的数组中,如下所示:
places:
0:"new Item"
1:"new Item",
2:"new Item"
.
.
.
等等,这就是我需要的。 但就我而言,数据如下所示:
这是我的代码:
this.user = this.db.list("/Users/"+ this.currentUserId+'/places');
this.user.push(["new Item"]);
当用户输入新位置时,我需要将新数据输入到数组中,而不是插入新数组。
谢谢。
【问题讨论】:
标签: arrays database angular firebase angularfire2