Mac Cruz
asked on
How to update IndexedDB
Hi experts, I want to update my IndexedDb that the value of msales be updated and be added to 30.00 to become 250.00 in result and the value of created will remain.
My IndexdDB
key = 1975 value = {msales: "220.00", created: "11-18-2019"}
Js
My IndexdDB
key = 1975 value = {msales: "220.00", created: "11-18-2019"}
Js
function gsaleslocal(){
var sales = "30.00"
var transaction = db.transaction(["gsales"],"readwrite");
var store = transaction.objectStore("gsales");
var mytrx = {
msales: sales,
};
var request = store.put(mytrx,1975);
request.onerror = function(e) {
console.log("Error", e.target.error.name);
}
request.onsuccess = function(e) {
console.log("Successfully added");
}
};
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
you welcome, have a nice day
ASKER