Set a parameter as a label

Is there a way to set a parameter as a label in neo4j version 5? Since apoc.create.addLabels is deprecated in apoc 5, is there any other procedure?

This is a link to the current apoc version. It does not show the procedure as deprecated.

Do you have a link to where you saw that?

1 Like

@andronaxm

additionally Parameters - Cypher Manual indicates where and where not parameters can be used. it does indicate

Parameters cannot be used for the following constructs, as these form part of the query structure that is compiled into a query plan:

* property keys; so MATCH (n) WHERE n.$param = 'something' is invalid

* relationship types; so MATCH (n)-[:$param]→(m) is invalid

* labels; so MATCH (n:$param) is invalid
1 Like

This apoc procedure allows you to construct a cypher statement as a string and execute it. As such, it is very flexible.

apoc.create.addLabels is still available in the APOC Core procedures. the problem was that it was not loaded from the configuration file. Now it works fine! Thank you for you feedback

1 Like