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

Details


Author:
Dana Canzano
Applicable versions:
3.0.x
Keywords:
APOCmove property to labelneo4j-3.0.x