Property value to a label

The available procedure is described in the table below:

Qualified Name Type Release

apoc.create.addLabels

- adds the given labels to the node or nodes

Procedure

APOC Core

Example Usage

The example below will help us learn how to use this procedure.

The following creates a Movie node with title and genre properties
CREATE (:Movie {title: 'A Few Good Men', genre: 'Drama'})
The following moves the 'genre' property to a label and removes it as a property
MATCH (n:Movie)
CALL apoc.create.addLabels( id(n), [ n.genre ] )
YIELD node
REMOVE node.genre
RETURN node