neo4j 查询

原文链接: neo4j 查询

上一篇: Python3 爬取豆瓣电影信息

下一篇: Windows 使用ssh 远程下载 上传 服务器上的文件和目录

查找由一条边相连接的两个点,即距离

match (n)-[*..1]-(m)
return n.id,m.id

220434_wb39_2856757.png

集合函数,查询每个点的周围节点个数

match (n)--(m)
return n.id,count(m.id)
order by n.id

221055_cQKS_2856757.png

匹配模式

Patterns
(n:Person)

Node with Person label.

(n:Person:Swedish)

Node with both Person and Swedish labels.

(n:Person {name: {value}})

Node with the declared properties.

(n)-->(m)

Relationship from n to m .

(n)--(m)

Relationship in any direction between n and m .

(n:Person)-->(m)

Node n labeled Person with relationship to m .

(m)<-[:KNOWS]-(n)

Relationship of type KNOWS from n to m .

(n)-[:KNOWS|:LOVES]->(m)

Relationship of type KNOWS or of type LOVES from n to m .

(n)-[r]->(m)

Bind the relationship to variable r .

(n)-[*1..5]->(m)

Variable length path of between 1 and 5 relationships from n to m .

(n)-[*]->(m)

Variable length path of any number of relationships from n to m . (See Performance section.)

(n)-[:KNOWS]->(m {property: {value}})

A relationship of type KNOWS from a node n to a node m with the declared property.

shortestPath((n1:Person)-[*..6]-(n2:Person))

Find a single shortest path.

allShortestPaths((n1:Person)-[*..6]->(n2:Person))

Find all shortest paths.

size((n)-->()-->())

Count the paths matching the pattern.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值