Re: [Neo4j] All shortest paths between a set of nodes

2017-12-12 Thread Liping Huang
Yes, thanks for much. 在 2017年12月12日星期二 UTC+8上午9:48:36,Michael Hunger写道: > > Just do two matches and collect and unwind the first one after you did the > 2nd one. > > MATCH (n:Entity) where n.name IN {IDS} > WITH collect(n) as nodes > > MATCH (m:Entity2) where m.name IN {IDS2} >

Re: [Neo4j] All shortest paths between a set of nodes

2017-12-11 Thread 'Michael Hunger' via Neo4j
Just do two matches and collect and unwind the first one after you did the 2nd one. MATCH (n:Entity) where n.name IN {IDS} WITH collect(n) as nodes MATCH (m:Entity2) where m.name IN {IDS2} UNWIND nodes as n WITH * WHERE id(n) < id(m) MATCH path = allShortestPaths(

[Neo4j] All shortest paths between a set of nodes

2017-12-11 Thread Liping Huang
Hi there, Here is a good example for this question - https://neo4j.com/developer/kb/all-shortest-paths-between-set-of-nodes/ but seems this is satisfy for the certain Label, for example "Entity" in the example cypher query. But how to use this for multiple labels? MATCH (n:Entity) where