Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
07-30-2020 01:16 PM
I am trying to retrieve all the nodes and edges (edges can be optional if it improves performance) that connect a set of nodes n, m, x, and y
I know the connectivity in advance:
(n)-[]->(m)-[]->(x)
(y)-[*]->(x)
What would be the most efficient way to gather all the nodes (without duplicates)?
What I have tried:
What I have found is that I can only get a decent performance with apoc.path.expandConfig, searching for other approaches (that I might have missed).
07-30-2020 02:04 PM
Hi,
If you just need to find distinct nodes then try
Match(n) return distinct n
07-30-2020 02:13 PM
@intouch.vivek The graph is much-much larger, I am only interested in a subgraph between a set of nodes
07-30-2020 02:21 PM
You can try nodes(path)
or you also look into https://neo4j.com/docs/labs/apoc/current/graph-querying/expand-subgraph-nodes/
08-01-2020 01:47 AM
Should subgraphNodes
and expandConfig
return the same result/nodes if used with the same uniqueness
setting?
08-07-2020 02:57 AM
For that you need to do a POC as haven't used expandConfig
All the sessions of the conference are now available online