How to 'duplicate' a node

Running community edition 4.3.2 on Ubuntu 20.04

Hi all,

I have the following question:

How can I duplicate a node, in a new node with another name, but maintaining all the properties?
Or, in orhet word, how can I duplicate the name changing the name of the node?

Example:

MATCH (p:Person)

CREATE (n:Node)
    SET n = {p}

This seems to work. It creates the new node will all the properties of the existing node, then overwrites a property (or more if you want, or add new ones).

match(n:Test{id:100})
with n
create (m:Test)
set m = n
set m.name = 'new name'
return m

1 Like