我正在使用Neo4j 2.0里程碑3。
目前有这个工作代码:
String DB_PATH = "/usr/local/Cellar/neo4j/community-1.8.1-unix/libexec/data/graph.db";
GraphDatabaseService graphDb = new GraphDatabaseFactory().newEmbeddedDatabase(DB_PATH);
Transaction tx = graphDb.beginTx();
try {
Node myNode = graphDb.createNode();
Label myLabel = DynamicLabel.label('Label_Name');
myNode.addLabel(myLabel);
tx.success();
}
finally {
tx.finish();
}
如何使用嵌入式API遍历具有Label_Name
答案 0 :(得分:1)
退房:
GlobalGraphOperations.at(graphDb).getAllNodesWithLabel(DynamicLabel.label('Label_Name'));