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.

mrksph
Node Clone

Hi,

I'm using Neo4j Enterprise Edition v4.2.1 and Spring Data Neo4j 6.0.3.

I have the following Query:

MATCH path=(b:BaseHierarchy)-[]->(n:Group)-[:PARENT_OF*]->(c:Client) 
WHERE n.code = 'BPCEG' AND c.industry = '1005' 
WITH collect(path) as paths, b 
WITH b, reduce(a=[], node in reduce(b=[],c in [aa in paths | nodes(aa)] | b + c) | case when node in a then a else a + node end) as nodes, reduce(d=[], relationship in reduce(e=[],f in [dd in paths | relationships(dd)] | e + f) | case when relationship in d then d else d + relationship end) as relationships 
RETURN b, relationships, nodes;

If I execute it in the Neo4j Browser I get the following graph:

But if I run the same query using

Neo4jTemplate.findOne(query, new HashMap<>(), BaseHierarchyNode.class)

The result only includes the first-level children of the blue node BPCEG.

Version history
Last update:
‎04-22-2021 04:14 AM
Updated by:
Contributors