<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

async def delete(self, *args, **kwargs):
        '''
        Corresponds to DELETE request with a resource identifier, deleting a single document from the database
        '''
        pk = self.pk_type(kwargs['pk'])
        result = await self._meta.object_class.delete_entries(db=self.db, query={self.pk: pk})
        if result.acknowledged:
            if result.deleted_count == 0:
                raise NotFound()
        else:
            raise BadRequest('Failed to delete object')