如何將對象添加到 firebase 中的對象數組?我可以使用此代碼創建一個對象數組,但我無法向其中添加對象。 return this.db.doc(`Users/${userCredential.user.uid}`).set({ email: this.newUser.email, firstname: this.newUser.firstName, lastname: this.newUser.lastName, balance: this.newUser.balance, movimentos: [ { valor: 69, tipo_movimento: 'Débito' }, { valor: 19, tipo_movimento: 'Crédito' }, { valor: 29, tipo_movimento: 'Débito' }, ] }) }我嘗試在數組中添加一個對象: return this.db.collection(`Users/${userKey}`).add({ movimentos: [ { valor: 6669, tipo_movimento: 'Débito' }, ] }); }
在 Angular/Firebase 的數組對象中添加對象
慕容3067478
2022-01-07 10:18:11