I have the following model for a Firestore document:
{
name: "test",
isActive: true,
items: [
{
id: "123",
itemName: "testItem",
qty: 1
},
{
id: "555",
itemName: "anotherItem",
qty: 5
}]
}
Now that Firestore allows to work with nested arrays (via arrayRemove / arrayUnion), I am wondering whether this is possible also through AngularFire2.
Or the only way so far is to import Firebase and using it straight ahead?
Like:
this.firestore.collection(<collectionName>).doc(<docID>).update({
answers: firestore.FieldValue.arrayUnion(<AnswersObject>)
});
Moreover is such a model with nested array legit in FIrestore or should it rather be structured in a different way?