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.

How to expand to nodes in a subgraph with their level returned?

We can use patterns to search a subgraph like this:

MATCH(a:Person{id:1})-[:Knows*1..]->(b:Person)

However, I find it takes too long when the subgraph is large. Therefore I use apoc procedure:

MATCH(a:Person{id:1})
CALL apoc.path.subgraphNodes(p,{
        relationshipFilter: "Knows>",
minLevel:1
})
YIELD node
return node.name as name.

It runs much faster ! The minLevel of the node is 1. The thing is I want to get the actual level of each node returned.
Anyone can help me? Thanks!

0 REPLIES 0