neo4j - 如何使用 Cypher 在 neo4j 上找到断开连接的节点?

标签 neo4j graph-databases cypher

我在玩neo4j并注意到所有的Cypher查询都需要在START中找到一个起点。条款。
我想知道如何使用 Cypher 找到所有断开连接的节点?

谢谢

最佳答案

如果您的所有节点都被索引(例如通过自动索引),您可以使用索引查询作为起点,然后找到那些没有传出关系的节点。

start n=node:node_auto_index("id:*")
match n-[r?]->m
where r is null
return n

现在我宁愿使用:
start n=node:node_auto_index("id:*")
where not (n-->m)
return n

关于neo4j - 如何使用 Cypher 在 neo4j 上找到断开连接的节点?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8669471/

相关文章:

java - Neo4j 密码来计算和显示两个给定节点之间的所有关系

neo4j - 在 Cypher (neo4j) 中更新多个属性

symfony - graphaware/neo4j-php-ogm 事件监听器

service - Neo4j 服务启动失败

owl - 带有 OWL API + DB 的在线本体编辑器?

Neo4j 密码查询语言 - bool 表达式的运算顺序

neo4j - 如何在 Neo4j 因果集群与 HA 集群之间做出决定

c# - 使用 C# 的 DEX 图形数据库 : Are there any code examples for graph export?

php - 从 PHP 连接到 OrientDB

python - 如何解析从 cypher 返回的列表集合?