删除属性
match(a:``) where a.name='acenaphthene' remove a.tyu=''
修改属性
match(a:``) where a.name='acenaphthene' set a.tyu=''
查询关系类别数量
match (a)-[r]->(b) return count(distinct r.name)
查询label类别数量
match (a) return count(distinct labels(a))
返回label
match (a) where a.name='未确定' return labels(a)
查询所有 城市 节点
MATCH (c:城市) RETURN c
查询所有 平台 节点
MATCH (p:平台) RETURN p
查询 平台 与 城市 两个节点的所有关系
match (p:平台)-[r]->(c:城市) return r
查询名称为 北京 的城市节点
match (c:城市) where c.name='北京' return c
查询 市长属性为 陈吉宁 的城市节点
match (c:城市) where c.市长='陈吉宁' return c
查询 北京 与 北京首都创业集团有限公司 的关系以及属性
match (p:平台)-[r]->(c:城市) where c.name='北京' and p.name='北京首都创业集团有限公司' return r
查询 注册_在 北京 的平台节点
match (p:平台)-[r:注册_在]->(c:城市) where c.name='北京' return p
查询 北京首都创业集团有限公司 注册_在 哪个城市的城市节点
match (p:平台)-[r:注册_在]->(c:城市) where p.name='北京首都创业集团有限公司' return c
查询 北京 书记属性 的值
match (c:城市) where c.name='北京' return c.书记
返回一个节点
catch (n:name) return n limit1
删除节点
catch(n:name) detach delete n
寻找两个节点最短的关系途径
match p=shortestPath((m:`库名`{name:'节点'})-[r*1..10]-(n:`库名`{name:'节点'})) return p
寻找两个节点所有最短的关系途径
match p=allshortestPaths(m:`库名`{name:'节点'})-[r*1..10]-(n:`库名`{name:'节点'})) return p
添加关系
match (a:库名),(b:库名) where b节点属性 = ' + 节点值 + ' and = a节点或属性名' + 节点值 + 'create (a)-[r:持有]->(b) return r
删除库名
match(n:库名)-[r:关系]->(b:库名) delete r
neo4j命令,待更新
最新推荐文章于 2024-07-11 22:36:37 发布