Update the Data of the Object Store
Learn to update the data present in the object store.
We'll cover the following
We can use the put()
method to update the data in the object store of the IndexedDB
database. Follow the steps below to update the data in the object store:
Open the database.
Create a
readwrite
transaction.Access the object store in which the data is to be updated.
Use the
put()
method to update the data in the object store.
We know how to open database connections, create transactions, and access object stores. Let’s learn about updating the data on the object store.
Update the data
Once we have the object store, we can update or add the data by calling the put()
method on the object store.
The syntax of the put()
method is as follows:
Get hands-on with 1400+ tech skills courses.