I’m trying to create multiple items in the firebase list using user’s UID as we can in image bellow
this is my method to create items
formCreate() {
this.service.save(this.products)
.then(() => {
this.navCtrl.setRoot('ProductPage');
})
............
}
and my service I have this code to save item in list
save(product: Product) {
return new Promise((resolve) => {
firebase.database()
.ref(`/products/`)
.child(product.user_id)
.set(product)
.then(() => resolve());
})
}
in this way the method is replacing the item to another item and not saving multiple items, how to resolve it’s ?
I realized that “set” update item and not save…