Skip to content

apoc.refactor.mergeNodes choose the result properties randomly #115

Closed
@neo-technology-build-agent

Description

Issue by PeterKazmirsky
Tuesday Feb 19, 2019 at 15:58 GMT
Originally opened as neo4j-contrib/neo4j-apoc-procedures#1107


Guidelines
Imagine that I have user cluster consisting of user ids from different data sources and all users are connected to one Root node. In case that user cluster contains more than one Root node I want to merge this Root nodes to one. For finding the Root nodes in cluster I am using apoc.path.subgraphNodes and the resulting Root nodes I am sending to apoc.refactor.mergeNodes to merge them to one Root node. I also set properties to procedure: mergeRels:true, properties:'overwrite'

Actual Behavior
I cannot influence in what order roots get into procedure apoc.refactor.mergeNodes, so after merging the result Root node and his relationships properties will have random properties.

Expected Behavior
I would like you to consider to add feature to apoc.refactor.mergeNodes where I can tell for example that for merging property "count" choose highest one. Or for "date" property choose latest one.
Thank you.

Versions
Neo4j 3.5.2
Apoc library 3.5.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions