You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
in my database I have multiple nodes that have the same properties, so I want to merge all of these nodes into one. Those nodes are connected by the relationship "similar", so I use gds weakly connected component to find these communities, then I'm using the following code to merge those nodes in the same community while using the apoc.periodic.iterate
CALL apoc.periodic.iterate('
MATCH (n:Officer)
WITH n.community AS com, collect(n) AS nodicom
RETURN nodicom
','
CALL apoc.refactor.mergeNodes(nodicom,{
properties:"discard", mergeRels:true, preserveExistingSelfRels:false}) YIELD node
',{batchSize: 200, parallel: true})
YIELD batches, total
RETURN batches, total
I'm expecting that all nodes grouped by community will be merged but it does not working.
Using the following code I have a lot of communities with more than 1 node:
match (n) with n.community as com, count(n) as contacom return com, contacom order by contacom desc
if I use:
MATCH (n:Officer) where n.community=239389
WITH n.community AS com, collect(n) AS nodicom
CALL apoc.refactor.mergeNodes(nodicom,{
properties:"discard", mergeRels:true, preserveExistingSelfRels:false})
yield node
return count(*)
it works. 239389 is an example of id community
Neo Desktop Version: 1.5.8
Database Version 5.5.0
APOC Version 5.5.0
on Windows 11 Home
The text was updated successfully, but these errors were encountered:
Minor typo: The title of this Issue should say mergeNodes instead of merge.
SimG92
changed the title
apoc.refactor.merge while using apoc.periodic.iterate seems not working
apoc.refactor.mergeNodes while using apoc.periodic.iterate seems not working
Oct 24, 2023
Hello,
in my database I have multiple nodes that have the same properties, so I want to merge all of these nodes into one. Those nodes are connected by the relationship "similar", so I use gds weakly connected component to find these communities, then I'm using the following code to merge those nodes in the same community while using the apoc.periodic.iterate
CALL apoc.periodic.iterate('
MATCH (n:Officer)
WITH n.community AS com, collect(n) AS nodicom
RETURN nodicom
','
CALL apoc.refactor.mergeNodes(nodicom,{
properties:"discard", mergeRels:true, preserveExistingSelfRels:false}) YIELD node
',{batchSize: 200, parallel: true})
YIELD batches, total
RETURN batches, total
I'm expecting that all nodes grouped by community will be merged but it does not working.
Using the following code I have a lot of communities with more than 1 node:
match (n) with n.community as com, count(n) as contacom return com, contacom order by contacom desc
if I use:
MATCH (n:Officer) where n.community=239389
WITH n.community AS com, collect(n) AS nodicom
CALL apoc.refactor.mergeNodes(nodicom,{
properties:"discard", mergeRels:true, preserveExistingSelfRels:false})
yield node
return count(*)
it works. 239389 is an example of id community
Neo Desktop Version: 1.5.8
Database Version 5.5.0
APOC Version 5.5.0
on Windows 11 Home
The text was updated successfully, but these errors were encountered: