Typescript FIrebase将数据推送到阵列中。正确的语法是什么?

Typescript FIrebase将数据推送到阵列中。正确的语法是什么?,typescript,firebase,google-cloud-firestore,ionic4,angular8,Typescript,Firebase,Google Cloud Firestore,Ionic4,Angular8,如何将7个条目推送到消息数组中。我使用了以下语法,但它不起作用,它覆盖了数组0索引 this.signleChat.doc(id).set({messages:{}},{merge:true}); 请帮助解决更新的firebase查询。要在消息数组中添加另一项,请执行以下操作: this.signleChat.doc(id).update({messages:{}}); 从: 要更新文档的某些字段而不覆盖整个文档,请使用update()方法

如何将7个条目推送到消息数组中。我使用了以下语法,但它不起作用,它覆盖了数组0索引

this.signleChat.doc(id).set({messages:{}},{merge:true});

请帮助解决更新的firebase查询。

要在消息数组中添加另一项,请执行以下操作:

this.signleChat.doc(id).update({messages:{}});
从:

要更新文档的某些字段而不覆盖整个文档,请使用
update()
方法