cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Using Cypher and APOC to move a property value to a label

Commencing with Neo4j 3.0.x and the introduction of stored procedures as well as APOC
one can utilize the stored procedure apoc.create.addLabels
to move a property to a label with Cypher as follows

<!-- // create a node with property studio -->
create (n:Movies {name: 'A Few Good Men', studio: 'Warner Brothers'})
<!-- // move the 'studio' property to a label and remove it as a property -->
MATCH (n:Movies) 
call apoc.create.addLabels([ id(n) ], [ n.studio ]) yield node 
with node 
remove node.studio
return node
0 REPLIES 0