0

我正在使用 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

4

1 回答 1

1

查看:

GlobalGraphOperations.at(graphDb).getAllNodesWithLabel(DynamicLabel.label('Label_Name'));

http://api.neo4j.org/current/org/neo4j/tooling/GlobalGraphOperations.html#getAllNodesWithLabel(org.neo4j.graphdb.Label)

于 2013-06-17T13:27:26.407 回答