REMOVE

The REMOVE clause deletes properties from vertices and edges.

Terminal REMOVE Clause

A REMOVE clause that is not followed by another clause is terminal. When a Cypher query ends with a terminal clause, the cypher() function call returns no result rows. However, the cypher() function still requires a column definition list. When the query ends in a terminal clause, define a dummy column in the column definition list — the variable will not yield any data.

Removing Properties

Cypher does not support storing NULL as a property value. Instead, a property is considered absent when no value is assigned. Therefore, removing a property from a vertex or edge is accomplished using REMOVE.

Query

SELECT *
FROM cypher('graph_name', $$
    MATCH (andres {name: 'Andres'})
    REMOVE andres.age
    RETURN andres
$$) AS (andres agtype);

Returns the vertex with the age property removed.

Result

andres
{id: 3; label: 'Person'; properties: {name: "Andres"}}::vertex
1 row returned