i need help with minor adjustment to a code,
i am using path expand to returns paths; the nodes and the relationships connecting them. however, it return the nodes in one column and the relationships in another. i also need to make this process more efficient.
match (n:Movie), (m:Person)
CALL apoc.path.expandConfig(n, {
relationshipFilter:"",
minLevel: 1,
maxLevel: 4,
uniqueness: "NODE_PATH"
})
YIELD path
WITH [x in nodes(path) | x.name] AS nodes,
[a in relationships(path) |type(a)] as relationships
return nodes, relationships
RETURNS something like this.
[null,"Joel Silver",null,"Andy Wachowski"] │["PRODUCED","PRODUCED","WROTE"]