cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Return only one instance of a node

I'm not really sure how to ask this. I have a graph in which there are multiple paths between nodes. If I use the syntax below, neo4j will return a value for each node pair and each path between the node pairs. I only want it to return one value per node pair, how do I do that?

MATCH (a)--(b:Item)--()--(d) WHERE id(a)=4 RETURN d.Name

1 REPLY 1

MuddyBootsCode
Graph Steward

You would need to use DISTINCT https://neo4j.com/docs/cypher-manual/current/clauses/return/#return-unique-results see if that works for you and welcome to the community!