When performing deletes, it is useful to be able to differentiate between "this item existed and was deleted" and "this did not exist, and there was nothing to delete". For example, a RESTful DELETE endpoint can return a 404 or 200 based on whether the item already existed or not.
Right now the only way to differentiate between the two is to first perform a lookup then delete, which is not even necessarily accurate since there can be a data race between the two operations.
A better way to do this might be to use the attribute_exists condition with the PK attribute to make the delete fail if the item does not exist.
When performing deletes, it is useful to be able to differentiate between "this item existed and was deleted" and "this did not exist, and there was nothing to delete". For example, a RESTful DELETE endpoint can return a 404 or 200 based on whether the item already existed or not.
Right now the only way to differentiate between the two is to first perform a lookup then delete, which is not even necessarily accurate since there can be a data race between the two operations.
A better way to do this might be to use the attribute_exists condition with the PK attribute to make the delete fail if the item does not exist.