Reputation: 679
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.
I am currently using:
MATCH n=node(*), m=node(*)
WHERE (n.name) AND (m.name) AND
n.name=m.name
RETURN n, m
In the hope to get a result showing all nodes with the same name
.
I am aware of this old 2013 post here: neo4j find all nodes with matching properties
But the Cypher code has been significantly updated since this date.
Any help would be great thanks.
Upvotes: 4
Views: 7867
Reputation: 41676
There are no tables in 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;
Upvotes: 7