我對neo4j有點新穎。我一直在努力,它看起來像下面neo4j中的ExecutionResult迭代不起作用
String query = String.format("start a = node:ids({id}) match a-[e]->b return "
+ "a.id, b.id, e;", Constants.ID_NAME_INDEX);
Map<String, Object> params = new HashMap();
params.put("id, "id:" + id);
ExecutionEngine engine = new ExecutionEngine(graphDb);
ExecutionResult rs = engine.execute(query, params);
for (Map<String, Object> row : rs) {
for (Entry<String, Object> column : row.entrySet()) {
String key = column.getKey();
String value = column.getValue().toString();
switch (key) {
case "a.id":
\\Some operation here
break;
case "b.id":
\\Some operation here
break;
case "e":
\\Some operation here
break;
}
}
}
一個代碼,並將其用於正常工作。出於某種原因,它停止正常工作。 我的問題是,執行查詢後,即使我可以看到通過調試返回了數百個結果;程序跳過結果集的迭代並跳轉到最後一行,就好像Iterator中沒有結果一樣。
我可能出現的邏輯缺陷是什麼? 我感謝任何幫助。
你使用的是什麼版本的Neo4j? 1.8,1.9或2.0? – tstorms 2013-05-02 13:47:26
我正在使用Neo4j 1.8.2社區版 – Zack 2013-05-03 12:21:53