You are currently browsing legacy 4.1 version of documentation. Click here to switch to the newest 5.1 version.
Session: Deleting entities
Entities can be marked for deletion by using
delete method, but will not be removed from server until
save_changes is called.
def delete(self, key_or_entity): def delete_by_entity(self, entity):
|entity or key_or_entity||entity, str or entity||instance of entity to delete or entity Id|
|expected_change_vector||str||A change vector to use for concurrency checks|
delete method can be used with entity or str. by calling delete with entity
delete_by_entity will be executed
employee = session.load("employees/1") session.delete(employee) session.save_changes()
employee = session.load("employees/1") session.delete_by_entity(employee)