Deleting Data
await gom.delete(Person, uuid); // returns how many: 1 or 0await gom.delete(Issue, uuid, { where: (q) => q.state.eq('closed') }); // only if it meets the conditionawait gom.deleteAll(Issue, (q) => ({ where: q.state.eq('closed') })); // what a load with the filter findsawait gom.deleteAll(RaisedAndAssignedIssue, (q) => ({ where: q.assignedTo.name.eq('Former Employee') }));await gom.deleteAll(Issue, 'n.locked = true'); // a predicate of your own, over nA delete removes the root and its relationships. The nodes they led to stay, unless the delete cascades. Deleting a view by id can also delete the nodes it reaches:
await gom.delete(SessionView, sessionId); // NONE: the root onlyawait gom.delete(SessionView, sessionId, { cascade: CascadeType.DELETE_ORPHAN }); // and each node left with no relationshipawait gom.delete(SessionView, sessionId, { cascade: CascadeType.DELETE_ALL }); // and every node in the viewThe cascade follows the view’s relationships, through nested views; a node outside the view is never deleted.
DELETE_ALL deletes nodes others may still point at, so use it for nodes the root owns. DELETE_ORPHAN isn’t available
on Memgraph.

