Delete the Data
Learn how to delete the data in the object store.
We'll cover the following
We can use the delete
method to delete specific data present in the object store.
Follow the steps below to delete data from the object store:
Open the database.
Create a
readwrite
transaction.Get the object store from the created transaction.
Delete the data of the specified key using the
delete
method.
The first three steps are covered in the previous lesson, so we can directly learn the fourth step.
The delete()
method
The delete()
method takes a single argument, which is the key of the record that we want to delete. If the key isn’t found, no error will be shown.
Example
Get hands-on with 1400+ tech skills courses.