2013-05-07 12 views
0

以下代碼打印id: 0。爲什麼在空的圖形數據庫中有一個節點?爲什麼neo4j總是有單個節點?

GraphDatabaseService db = new GraphDatabaseFactory().newEmbeddedDatabase(DB_LOCATION); 
GlobalGraphOperations graphOperations = GlobalGraphOperations.at(db); 
System.out.println("id: "+graphOperations.getAllNodes().iterator().next().getId()); 

回答

2

默認情況下,Neo4j的與他們所稱的Reference Node是節點0。您可以刪除這個沒有後果產生,我認爲,它可能在未來的版本中被淘汰,正如你可以從它的文檔中看到的那樣,他們不贊成調用來檢索它。

相關問題