FIrebase 将数据推入数组。什么是正确的语法?
FIrebase push data into array. what is the proper syntax?
如何将 7 个条目推送到消息数组中。我使用以下语法,但它不起作用,它覆盖了数组 0 索引。
this.signleChat.doc(id).set({messages:{}},{merge:true});
请帮助解决更新的 firebase 查询。
要在消息数组中添加另一个条目,请执行以下操作:
this.signleChat.doc(id).update({messages:{}});
来自docs:
To update some fields of a document without overwriting the entire document, use the update()
method.
如何将 7 个条目推送到消息数组中。我使用以下语法,但它不起作用,它覆盖了数组 0 索引。
this.signleChat.doc(id).set({messages:{}},{merge:true});
请帮助解决更新的 firebase 查询。
要在消息数组中添加另一个条目,请执行以下操作:
this.signleChat.doc(id).update({messages:{}});
来自docs:
To update some fields of a document without overwriting the entire document, use the
update()
method.