【发布时间】:2020-04-17 10:44:12
【问题描述】:
我需要将 id 从 firebase 推送到同一个对象中。问题是我需要保存在同一个对象中而不是新对象中。
db.collection("form").where("posted_at", ">=", 1)
.get()
.then(querySnapshot => {
querySnapshot.forEach(doc=> {
console.log(doc.id, " => ", doc.data());
this.array.push(doc.data()); //if i do something like this: this.array.push(doc.data(),{id:doc.id}); it saves but in new object
});
})
【问题讨论】:
标签: javascript node.js firebase vue.js firebase-realtime-database