在 Neo4J 中查找具有相同属性的节点

Find Nodes with the same properties in Neo4J

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

我目前正在使用:

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

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

我知道这个旧的 2013 post 在这里:neo4j find all nodes with matching properties

但 Cypher 代码自此日期以来已进行了重大更新。

如有帮助将不胜感激。

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;