var refTypes = db.ref("products").child(productId);
var updates = {};
updates[productId] = newProduct;
refTypes.update(updates).then(()=>{
console.log("Data saved successfully.");
}).catch((error)=> {
console.log("Data could not be saved." + error);
});