REMOVE

更新时间:2025-01-09 07:26:20

REMOVE子句用于从顶点和边中移除属性。

终止性REMOVE子句

一个不跟随其他子句的REMOVE子句是一个终止子句。当Cypher查询以终止子句结束时,Cypher函数调用不会返回任何结果。然而,Cypher函数调用仍然需要列定义。当Cypher以终止节点结束时,在列定义中定义一个单一值:在这个变量中不会返回任何数据。

删除属性

Cypher不允许在属性中存储null。如果不存在值,该属性就根本不存在。因此,删除节点或关系上的属性值同样使用REMOVE

示例

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

返回的节点上没有age属性。

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

  • 本页导读 (1)
  • 终止性REMOVE子句
  • 删除属性

点击开启售前

在线咨询服务