关于Neo4j的使用及其基本命令

关于Neo4j的使用

文章目录

1、启动方式

进入bin目录:

properties 复制代码
neo4j console

2、创建新节点,节点内有属性

cypher 复制代码
create (:大学{name:"北京邮电大学"})

create (:院系{name:"计算机学院"})

先创建了两个节点:

3、创建关系

cypher 复制代码
match (p1:大学),(p2:院系) Create(p1)-[r:院系]->(p2)

这个关系创建完成!

4、查询节点

cypher 复制代码
match (n:大学)
where n.name='北京邮电大学'
return n

n代表节点,可以替换。

5、查询关系

cypher 复制代码
match (:大学{name:'北京邮电大学'})-[r]->(:院系{name:"计算机学院"}) return r

6、删除两个节点的关系

必须先删除关系才能删除节点:

cypher 复制代码
match (:大学{name:'北京邮电大学'})-[r]->(:院系{name:"计算机学院"}) delete r

7、删除节点

cypher 复制代码
match (a:大学{name:"北京邮电大学"}) delete a

8、删除某个标签的全部关系

cypher 复制代码
match (:大学{name:'北京邮电大学'})-[r]->() delete r

9、某个节点添加属性

cypher 复制代码
match (a:大学) where a.name="北京邮电大学" set a.sal="123" return a

10、删除节点某个属性

cypher 复制代码
match (a:大学) where a.name="北京邮电大学" remove a.sal
相关推荐
serve the people18 小时前
tensorflow 零基础吃透:TensorFlow 稀疏张量(SparseTensor)的核心用法
人工智能·tensorflow·neo4j
serve the people19 小时前
tensorflow 零基础吃透:RaggedTensor 的不规则形状与广播机制
人工智能·tensorflow·neo4j
serve the people19 小时前
tensorflow 零基础吃透:RaggedTensor 的底层编码原理
人工智能·tensorflow·neo4j
MasonYyp2 天前
简单使用FalkorDB和Neo4j图数据库
数据库·neo4j
黑客思维者3 天前
XGW-9000系列高端新能源电站边缘网关技术可行性分析报告V2
neo4j
serve the people3 天前
tensorflow 零基础吃透:RaggedTensor 的索引与切片(规则 + 示例 + 限制)
人工智能·tensorflow·neo4j
serve the people3 天前
tensorflow 零基础吃透:RaggedTensor 与其他张量类型的转换
人工智能·tensorflow·neo4j
serve the people4 天前
tensorflow 零基础吃透:tf.function 与 RaggedTensor 的结合使用
人工智能·tensorflow·neo4j
serve the people4 天前
tensorflow 零基础吃透:SavedModel 与 RaggedTensor 的结合使用
人工智能·tensorflow·neo4j
serve the people4 天前
tensorflow 零基础吃透:RaggedTensor 的重载运算符
人工智能·tensorflow·neo4j