Reputation: 119
What I'm trying to do is to add a new reference to this object:
Just insert a new element inside "citas". This is what I have so far.
database.collection('NegociosDev').doc('Peluquerías')
.collection('Negocios').doc('PR01').collection('empleados').where('Nombre', '==','Ale')...
I guess I shouldn't use "add()" as it is used to add a new document right? Any ideas?
Upvotes: 0
Views: 153
Reputation: 668
Indeed, you should update your document this way:
database.collection('NegociosDev').doc('Peluquerías').update({
citas: firebase.firestore.FieldValue.arrayUnion("new value")
})
Upvotes: 2