How to Sum nodes in firebase firestore?
问题 I am making app for ordering pizza. Like you see on image i want to take all key values named "ukupno" from each document and Sum it for final price. This is how i fetch cart data: this.cartService.getCart(this.user.Uid).subscribe(res => { this.cart = res.map(i => { return { ...i.payload.doc.data(), id: i.payload.doc.id }; }); }); } getCart(uid) { return this.firestore .collection("cart/") .doc(uid) .collection("/ubaceno") .snapshotChanges(); } 回答1: There are basically two ways to sum up the