async addToCart(product: Product) {
const cartId = await this.getOrCreateId();
const item$ = this.db.object('/shopping-carts/' + cartId + '/items/' + product.key );
item$.snapshotChanges().pipe(
take(1)
).subscribe(item => {
item$.update({product, quantity: item.quantity + 1 });
});
}
在RTDB firebase中进行收集后,我想从中访问值,但遇到此错误:
"Property 'quantity' does not exist on type 'AngularFireAction<DatabaseSnapshot<{}>>' "
这是我的数据库,我想访问item.quantity
: