Memory
hm_forget
Delete a node with its relationships, or a single edge
hm_forget removes something from memory. Pass a key to delete a node and every relationship attached to it, or an edge_id to delete just one edge or hyperedge and keep the nodes.
Parameters
| Parameter | Type | Description |
|---|---|---|
key | string | The node to delete, together with all of its edges. |
edge_id | string | The id of one binary edge or hyperedge to delete. The connected nodes are kept. Mutually exclusive with key. |
edge_version | integer | Optional write_version for optimistic concurrency when deleting an edge. |
Deleting a heavily connected node
Most nodes are deleted in one transaction and the result has status: "deleted".
A node with more connected edges than one transaction removes (25 by default) is hidden from every read immediately and removed in the background. Over REST this answers 202 Accepted.
- The result has
accepted: true,status: "deleting",deleted: falseandrelationships_remaining. - Call
hm_forgetagain with the same key to see progress.deletedbecomestrueonly when the node is gone. - Until then the key can’t be stored again (
node_deleting) and new relationships to it are refused.
Response
| Field | Description |
|---|---|
deleted | true once the node or edge is gone. |
status | "deleted", "deleting" or "not_found". |
accepted | true when a background deletion was started. |
key / edge_id | What was targeted. |
kind | For an edge: binary or hyperedge. |
relationships_total, relationships_remaining | Progress of a background deletion. |
deletion_id, operation_id | Identifiers of the deletion. |
replayed | true when this deletion had already been applied. |
Examples
{ "key": "fact_old_pricing" }
{ "edge_id": "9b3e41d7-2c58-5f06-a1b4-7d20e6c93f85" }