Update the Data of the Object Store

Learn to update the data present in the object store.

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:

  1. Open the database.

  2. Create a readwrite transaction.

  3. Access the object store in which the data is to be updated.

  4. 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 1200+ tech skills courses.