How can we copy labels from one node to another in one cypher?

15 views
Skip to first unread message

zhang han

unread,
Feb 9, 2016, 12:45:24 AM2/9/16
to Neo4j
The question is just as the title, and the cypher statement is just like the follow:
Match (n: test) CREATE (copy : LABELS(n)) set copy = n
Its purpose is to create a node with the same properties and same labels as the other node, but it doesn't work now because we can't use a expression like "LABELS(n)" to set lobel to a node.
How can I make it work?

Michael Hunger

unread,
Feb 9, 2016, 1:01:50 AM2/9/16
to ne...@googlegroups.com
Right now that's unfortunately not possible with Cypher.

You will have to match + enumerate manually.

--
You received this message because you are subscribed to the Google Groups "Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Michael Hunger

unread,
Feb 9, 2016, 1:08:23 AM2/9/16
to ne...@googlegroups.com
I look into providing a procedure / extension for that.
Reply all
Reply to author
Forward
0 new messages