Deleting
Last updated
Last updated
Use to delete resources.
In this example, we delete the books resource with an ID of 24.
Should you ever need to delete every resource of a specific resource type, you can also do that using remove()
.
You can use remove
to delete more than one resource at a time. Here's an example that demonstrates deleting a handful of books, a pair of authors, and every movie:
update()
to Delete a ResourceYou may choose to use one over the other when it makes sense as part of a bulk operation.
For instance, in the following call to store.update()
, we are able to update the attributes of one resource while deleting another at the same time:
Had we used remove()
to delete the resource, we would have had to update the other resource in a separate call to update()
, which is why in this situation it made more sense to use update
to do both at the same time.
Passing null
as a resource to will delete the resource.