在 Neo4J 中查找具有相同属性的节点 [英] Find Nodes with the same properties in Neo4J

查看:29
本文介绍了在 Neo4J 中查找具有相同属性的节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Neo4J 中有两个数据集.我想在这两个数据集中找到具有相同特定属性的所有节点.这是使用 Cypher 代码.

I have two datasets in Neo4J. I would like to find all nodes within these two datasets that have the same particular property. This is using Cypher code.

我目前正在使用:

MATCH n=node(*), m=node(*)
WHERE (n.name) AND (m.name) AND 
  n.name=m.name 
RETURN n, m

希望得到一个结果,显示所有具有相同name的节点.

In the hope to get a result showing all nodes with the same name.

我知道这里是 2013 年的旧帖子:neo4j 找到所有节点匹配属性

I am aware of this old 2013 post here: neo4j find all nodes with matching properties

但自此日期以来,Cypher 代码已显着更新.

But the Cypher code has been significantly updated since this date.

如有任何帮助,将不胜感激.

Any help would be great thanks.

推荐答案

Neo4j 中没有表

create index on :LabelA(propertyA);
create index on :LabelB(propertyB);

MATCH (a:LabelA)
MATCH (b:LabelB)
WHERE b.propertyB = a.propertyA
RETURN a,b;

这篇关于在 Neo4J 中查找具有相同属性的节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆