![](/img/trans.png)
[英]Is there another way to create graphDb node in Neo4j in Java API?
[英]How to create a node with multiple node in neo4j using java api
我正在學習neo4j的基礎知識,並嘗試使用多個標簽創建節點但不能這樣做。
問題:如何使用java api創建neo4j節點。 我一次只能向節點添加一個標簽。
使用neo4j 3.4.6
注意:我不想使用cypher,但只想使用java api
/* This will create a node with label MY_LABEL */
Node tnode = db.createNode(Label.label("MY_LABEL"));
GraphDatabaseService.createNode(Label... labels)
方法允許您使用多個Label
對象作為其參數。 因此,您應該簡單地調用方法,如db.createNode(Label.label("MY_LABEL"), Label.label("MY_LABEL_1"), Label.label("MY_LABEL_2"), Label.label("MY_LABEL_3"));
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.