0

我想要做的是为这个对象添加一个新的引用:

火库

只需在“citas”中插入一个新元素。这就是我到目前为止所拥有的。

database.collection('NegociosDev').doc('Peluquerías')
    .collection('Negocios').doc('PR01').collection('empleados').where('Nombre', '==','Ale')...

我想我不应该使用“add()”,因为它是用来添加新文档的,对吧?有任何想法吗?

4

1 回答 1

2

实际上,您应该以这种方式更新您的文档:

database.collection('NegociosDev').doc('Peluquerías').update({
   citas: firebase.firestore.FieldValue.arrayUnion("new value")
})
于 2020-07-30T10:18:57.107 回答