Closed mrksph closed 3 years ago
We made some improvements to the mapping of related of related entities in the last versions of 6.0.x Could you upgrade to 6.0.8 and see if the problem still exist? Also your query should become now more performant because you could use
MATCH path=(b:BaseHierarchy)-[]->(n:Group)-[:PARENT_OF*]->(c:Client)
WHERE n.code = 'BPCEG' AND c.industry = '1005'
RETURN b, collect(nodes(p)), collect(relationships(p));
Hi Gerrit, I'll give it a try, for now I tried to run the query with the changes you mention in the browser but the query couldn't be rendered as nodes and edges, could it be because it's intended to be used only with SDN?
Hi, I've just run the query with the changes you said but the results come duplicated. I'm using SDN 6.0.8
If there's any info or detail I can provide to make it easier for you guys please just ask, thanks.
Duplicates are expected with this query. You can still use the other style if you prefer this. It is basically either let the database do the work (reduce style query) or SDN / application side (collect style).
Ok, I fixed my problem with the duplicates using
apoc.coll.toSet(apoc.coll.flatten(collect(relationships))) as relationships,
apoc.coll.toSet(apoc.coll.flatten(collect(nodes))) as nodes;
So we can close this issue now?
Yes thank you Gerrit, as always
Hi,
I'm using Neo4j Enterprise Edition v4.2.1 and Spring Data Neo4j 6.0.3.
I have the following Query:
If I run this query 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.
The data model is not the problem, as I can successfully retrieve the (correct) graph
Using Neo4jClient.query(query).fetch().one() I get the following result:
The same node/relationships count as the result of executing the query against Neo4j Browser.