提交 f0fcd2ef 编写于 作者: M Mark Needham

apoc.create.addLabels

上级 2a502926
......@@ -32,5 +32,9 @@ apoc.create.addLabels(nodes :: ANY?, label :: LIST? OF STRING?) :: (node :: NODE
|node|NODE?
|===
[[usage-apoc.create.addLabels]]
== Usage Examples
include::partial$usage/apoc.create.addLabels.adoc[]
xref::graph-updates/data-creation.adoc[More documentation of apoc.create.addLabels,role=more information]
The examples in this section are based on the following sample graph:
[source,cypher]
----
CREATE (:Movie {title: 'A Few Good Men', genre: 'Drama'});
----
We can move the 'genre' property to a label and remove it as a property by running the following query:
[source,cypher]
----
MATCH (n:Movie)
CALL apoc.create.addLabels( n, [ n.genre ] )
YIELD node
REMOVE node.genre
RETURN node;
----
.Results
[opts="header",cols="1"]
|===
| node
| (:Movie:Drama {title: "A Few Good Men"})
|===
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册