apoc.nodes.collapse

Details

Syntax

apoc.nodes.collapse(nodes [, config ]) :: (from, rel, to)

Description

Merges NODE values together in the given LIST<NODE>. The NODE values are then combined to become one NODE, with all labels of the previous NODE values attached to it, and all RELATIONSHIP values pointing to it.

Input arguments

Name

Type

Description

nodes

LIST<NODE>

The list of node values to merge.

config

MAP

{ mergeRels :: BOOLEAN, selfRef :: BOOLEAN, produceSelfRef = true :: BOOLEAN, preserveExistingSelfRels = true :: BOOLEAN, countMerge = true :: BOOLEAN, collapsedLabel :: BOOLEAN, singleElementAsArray = false :: BOOLEAN, avoidDuplicates = false :: BOOLEAN, relationshipSelectionStrategy = "incoming" :: ["incoming", "outgoing", "merge"] properties :: ["overwrite", "discard", "combine"] }. The default is: {}.

Return arguments

Name

Type

Description

from

NODE

The recently collapsed virtual node.

rel

RELATIONSHIP

A relationship connected to the collapsed node.

to

NODE

A node connected to the other end of the relationship.